Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated Latest Changes for v2021-02-25 (External Products & References) #308

Merged
merged 1 commit into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 139 additions & 0 deletions lib/recurly.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2676,6 +2676,23 @@ export declare class ExternalProduct {

}

export declare class ExternalProductReferenceCollection {
/**
* Will always be List.
*/
object?: string | null;
/**
* Indicates there are more results on subsequent pages.
*/
hasMore?: boolean | null;
/**
* Path to subsequent page of results.
*/
next?: string | null;
data?: ExternalProductReferenceMini[] | null;

}

export declare class BinaryFile {
data?: string | null;

Expand Down Expand Up @@ -4446,6 +4463,48 @@ export interface MeasuredUnitUpdate {

}

export interface ExternalProductCreate {
/**
* External product name.
*/
name?: string | null;
/**
* Recurly plan UUID.
*/
planId?: string | null;
/**
* List of external product references of the external product.
*/
externalProductReferences?: ExternalProductReferenceBase[] | null;

}

export interface ExternalProductReferenceBase {
/**
* A code which associates the external product to a corresponding object or resource in an external platform like the Apple App Store or Google Play Store.
*/
referenceCode?: string | null;
externalConnectionType?: string | null;

}

export interface ExternalProductUpdate {
/**
* Recurly plan UUID.
*/
planId?: string | null;

}

export interface ExternalProductReferenceCreate {
/**
* A code which associates the external product to a corresponding object or resource in an external platform like the Apple App Store or Google Play Store.
*/
referenceCode?: string | null;
externalConnectionType?: string | null;

}

export interface InvoiceUpdate {
/**
* This identifies the PO number associated with the invoice. Not editable for credit invoices.
Expand Down Expand Up @@ -7958,6 +8017,16 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`.
* @return {Pager<ExternalProduct>} A list of the the external_products on a site.
*/
listExternalProducts(options?: object): Pager<ExternalProduct>;
/**
* Create an external product
*
* API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_external_product
*
*
* @param {ExternalProductCreate} body - The object representing the JSON request to send to the server. It should conform to the schema of {ExternalProductCreate}
* @return {Promise<ExternalProduct>} Returns the external product
*/
createExternalProduct(body: ExternalProductCreate): Promise<ExternalProduct>;
/**
* Fetch an external product
*
Expand All @@ -7968,6 +8037,76 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`.
* @return {Promise<ExternalProduct>} Settings for an external product.
*/
getExternalProduct(externalProductId: string): Promise<ExternalProduct>;
/**
* Update an external product
*
* API docs: https://developers.recurly.com/api/v2021-02-25#operation/update_external_product
*
*
* @param {string} externalProductId - External product id
* @param {ExternalProductUpdate} body - The object representing the JSON request to send to the server. It should conform to the schema of {ExternalProductUpdate}
* @return {Promise<ExternalProduct>} Settings for an external product.
*/
updateExternalProduct(externalProductId: string, body: ExternalProductUpdate): Promise<ExternalProduct>;
/**
* Deactivate an external product
*
* API docs: https://developers.recurly.com/api/v2021-02-25#operation/deactivate_external_products
*
*
* @param {string} externalProductId - External product id
* @return {Promise<ExternalProduct>} Deactivated external product.
*/
deactivateExternalProducts(externalProductId: string): Promise<ExternalProduct>;
/**
* List the external product references for an external product
*
* API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_external_product_external_product_references
*
*
* @param {string} externalProductId - External product id
* @param {Object} options - Optional configurations for the request
* @param {Object} options.params - The optional url parameters for this request.
* @param {string} options.params.sort - Sort field. You *really* only want to sort by `updated_at` in ascending
* order. In descending order updated records will move behind the cursor and could
* prevent some records from being returned.
*
* @return {Pager<ExternalProductReferenceCollection>} A list of the the external product references for an external product.
*/
listExternalProductExternalProductReferences(externalProductId: string, options?: object): Pager<ExternalProductReferenceCollection>;
/**
* Create an external product reference on an external product
*
* API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_external_product_external_product_reference
*
*
* @param {string} externalProductId - External product id
* @param {ExternalProductReferenceCreate} body - The object representing the JSON request to send to the server. It should conform to the schema of {ExternalProductReferenceCreate}
* @return {Promise<ExternalProductReferenceMini>} Details for the external product reference.
*/
createExternalProductExternalProductReference(externalProductId: string, body: ExternalProductReferenceCreate): Promise<ExternalProductReferenceMini>;
/**
* Fetch an external product reference
*
* API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_external_product_external_product_reference
*
*
* @param {string} externalProductId - External product id
* @param {string} externalProductReferenceId - External product reference ID, e.g. `d39iun2fw1v4`.
* @return {Promise<ExternalProductReferenceMini>} Details for an external product reference.
*/
getExternalProductExternalProductReference(externalProductId: string, externalProductReferenceId: string): Promise<ExternalProductReferenceMini>;
/**
* Deactivate an external product reference
*
* API docs: https://developers.recurly.com/api/v2021-02-25#operation/deactivate_external_product_external_product_reference
*
*
* @param {string} externalProductId - External product id
* @param {string} externalProductReferenceId - External product reference ID, e.g. `d39iun2fw1v4`.
* @return {Promise<ExternalProductReferenceMini>} Details for an external product reference.
*/
deactivateExternalProductExternalProductReference(externalProductId: string, externalProductReferenceId: string): Promise<ExternalProductReferenceMini>;
/**
* List a site's external subscriptions
*
Expand Down
115 changes: 115 additions & 0 deletions lib/recurly/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2350,6 +2350,21 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`.
return new Pager(this, path, options)
}

/**
* Create an external product
*
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/create_external_product}
*
*
* @param {ExternalProductCreate} body - The object representing the JSON request to send to the server. It should conform to the schema of {ExternalProductCreate}
* @return {Promise<ExternalProduct>} Returns the external product
*/
async createExternalProduct (body, options = {}) {
let path = '/external_products'
path = this._interpolatePath(path)
return this._makeRequest('POST', path, body, options)
}

/**
* Fetch an external product
*
Expand All @@ -2365,6 +2380,106 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`.
return this._makeRequest('GET', path, null, options)
}

/**
* Update an external product
*
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/update_external_product}
*
*
* @param {string} externalProductId - External product id
* @param {ExternalProductUpdate} body - The object representing the JSON request to send to the server. It should conform to the schema of {ExternalProductUpdate}
* @return {Promise<ExternalProduct>} Settings for an external product.
*/
async updateExternalProduct (externalProductId, body, options = {}) {
let path = '/external_products/{external_product_id}'
path = this._interpolatePath(path, { 'external_product_id': externalProductId })
return this._makeRequest('PUT', path, body, options)
}

/**
* Deactivate an external product
*
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/deactivate_external_products}
*
*
* @param {string} externalProductId - External product id
* @return {Promise<ExternalProduct>} Deactivated external product.
*/
async deactivateExternalProducts (externalProductId, options = {}) {
let path = '/external_products/{external_product_id}'
path = this._interpolatePath(path, { 'external_product_id': externalProductId })
return this._makeRequest('DELETE', path, null, options)
}

/**
* List the external product references for an external product
*
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/list_external_product_external_product_references}
*
*
* @param {string} externalProductId - External product id
* @param {Object} options - Optional configurations for the request
* @param {Object} options.params - The optional url parameters for this request.
* @param {string} options.params.sort - Sort field. You *really* only want to sort by `updated_at` in ascending
* order. In descending order updated records will move behind the cursor and could
* prevent some records from being returned.
*
* @return {Pager<ExternalProductReferenceCollection>} A list of the the external product references for an external product.
*/
listExternalProductExternalProductReferences (externalProductId, options = {}) {
let path = '/external_products/{external_product_id}/external_product_references'
path = this._interpolatePath(path, { 'external_product_id': externalProductId })
return new Pager(this, path, options)
}

/**
* Create an external product reference on an external product
*
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/create_external_product_external_product_reference}
*
*
* @param {string} externalProductId - External product id
* @param {ExternalProductReferenceCreate} body - The object representing the JSON request to send to the server. It should conform to the schema of {ExternalProductReferenceCreate}
* @return {Promise<ExternalProductReferenceMini>} Details for the external product reference.
*/
async createExternalProductExternalProductReference (externalProductId, body, options = {}) {
let path = '/external_products/{external_product_id}/external_product_references'
path = this._interpolatePath(path, { 'external_product_id': externalProductId })
return this._makeRequest('POST', path, body, options)
}

/**
* Fetch an external product reference
*
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/get_external_product_external_product_reference}
*
*
* @param {string} externalProductId - External product id
* @param {string} externalProductReferenceId - External product reference ID, e.g. `d39iun2fw1v4`.
* @return {Promise<ExternalProductReferenceMini>} Details for an external product reference.
*/
async getExternalProductExternalProductReference (externalProductId, externalProductReferenceId, options = {}) {
let path = '/external_products/{external_product_id}/external_product_references/{external_product_reference_id}'
path = this._interpolatePath(path, { 'external_product_id': externalProductId, 'external_product_reference_id': externalProductReferenceId })
return this._makeRequest('GET', path, null, options)
}

/**
* Deactivate an external product reference
*
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/deactivate_external_product_external_product_reference}
*
*
* @param {string} externalProductId - External product id
* @param {string} externalProductReferenceId - External product reference ID, e.g. `d39iun2fw1v4`.
* @return {Promise<ExternalProductReferenceMini>} Details for an external product reference.
*/
async deactivateExternalProductExternalProductReference (externalProductId, externalProductReferenceId, options = {}) {
let path = '/external_products/{external_product_id}/external_product_references/{external_product_reference_id}'
path = this._interpolatePath(path, { 'external_product_id': externalProductId, 'external_product_reference_id': externalProductReferenceId })
return this._makeRequest('DELETE', path, null, options)
}

/**
* List a site's external subscriptions
*
Expand Down
31 changes: 31 additions & 0 deletions lib/recurly/resources/ExternalProductReferenceCollection.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* istanbul ignore file */
/**
* This file is automatically created by Recurly's OpenAPI generation process
* and thus any edits you make by hand will be lost. If you wish to make a
* change to this file, please create a Github issue explaining the changes you
* need and we will usher them to the appropriate places.
*/
'use strict'

const Resource = require('../Resource')

/**
* ExternalProductReferenceCollection
* @typedef {Object} ExternalProductReferenceCollection
* @prop {Array.<ExternalProductReferenceMini>} data
* @prop {boolean} hasMore - Indicates there are more results on subsequent pages.
* @prop {string} next - Path to subsequent page of results.
* @prop {string} object - Will always be List.
*/
class ExternalProductReferenceCollection extends Resource {
static getSchema () {
return {
data: ['ExternalProductReferenceMini'],
hasMore: Boolean,
next: String,
object: String
}
}
}

module.exports = ExternalProductReferenceCollection
1 change: 1 addition & 0 deletions lib/recurly/resources/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ module.exports.Item = require('./Item')
module.exports.Pricing = require('./Pricing')
module.exports.MeasuredUnit = require('./MeasuredUnit')
module.exports.ExternalProduct = require('./ExternalProduct')
module.exports.ExternalProductReferenceCollection = require('./ExternalProductReferenceCollection')
module.exports.BinaryFile = require('./BinaryFile')
module.exports.Plan = require('./Plan')
module.exports.PlanRampInterval = require('./PlanRampInterval')
Expand Down
Loading