From 6657cf3448cbf9921ecaf40d8c78b6ff438fdafb Mon Sep 17 00:00:00 2001 From: Azeem Muzammil Date: Fri, 5 Jan 2024 14:29:17 +0530 Subject: [PATCH] Add listCustomers EP --- openapi/stripe/Ballerina.toml | 2 +- openapi/stripe/client.bal | 17 +++++ openapi/stripe/openapi.yaml | 122 ++++++++++++++++++++++++++++++++++ openapi/stripe/types.bal | 10 +++ 4 files changed, 150 insertions(+), 1 deletion(-) diff --git a/openapi/stripe/Ballerina.toml b/openapi/stripe/Ballerina.toml index ac6a8b199..54e63b915 100644 --- a/openapi/stripe/Ballerina.toml +++ b/openapi/stripe/Ballerina.toml @@ -6,7 +6,7 @@ name = "stripe" icon = "icon.png" distribution = "2201.4.1" repository = "https://github.com/ballerina-platform/openapi-connectors/tree/main/openapi/stripe" -version = "1.6.1" +version = "1.6.2" authors = ["Ballerina"] [build-options] observabilityIncluded = true diff --git a/openapi/stripe/client.bal b/openapi/stripe/client.bal index 698c27ae6..be42f1989 100644 --- a/openapi/stripe/client.bal +++ b/openapi/stripe/client.bal @@ -81,6 +81,23 @@ public isolated client class Client { Coupon response = check self.clientEp->get(resourcePath); return response; } + #

Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.

+ # + # + email - A case-sensitive filter on the list based on the customer's `email` field. The value must be a string. + # + endingBefore - A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + # + expand - Specifies which fields in the response should be expanded. + # + 'limit - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + # + startingAfter - A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + # + testClock - Provides a list of customers that are associated with the specified test clock. The response will not include customers with test clocks if this parameter is not set. + # + return - Successful response. + remote isolated function listCustomers(CreatedDetails? created = (), string? email = (), string? endingBefore = (), string[]? expand = (), int? 'limit = (), string? startingAfter = (), string? testClock = ()) returns CustomerResourceCustomerList|error { + string resourcePath = string `/v1/customers`; + map queryParam = {"created": created, "email": email, "ending_before": endingBefore, "expand": expand, "limit": 'limit, "starting_after": startingAfter, "test_clock": testClock}; + map queryParamEncoding = {"created": {style: DEEPOBJECT, explode: true}, "expand": {style: DEEPOBJECT, explode: true}}; + resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); + CustomerResourceCustomerList response = check self.clientEp->get(resourcePath); + return response; + } #

Creates a new customer object.

# # + payload - Customer details diff --git a/openapi/stripe/openapi.yaml b/openapi/stripe/openapi.yaml index b771e7324..a168214d9 100644 --- a/openapi/stripe/openapi.yaml +++ b/openapi/stripe/openapi.yaml @@ -24614,6 +24614,128 @@ paths: "$ref": "#/components/schemas/error" description: Error response. "/v1/customers": + get: + description: "

Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.

" + operationId: listCustomers + parameters: + - explode: true + in: query + name: created + required: false + schema: + $ref: '#/components/schemas/CreatedDetails' + style: deepObject + - description: >- + A case-sensitive filter on the list based on the customer's `email` + field. The value must be a string. + in: query + name: email + required: false + schema: + maxLength: 512 + type: string + style: form + - description: >- + A cursor for use in pagination. `ending_before` is an object ID that + defines your place in the list. For instance, if you make a list + request and receive 100 objects, starting with `obj_bar`, your + subsequent call can include `ending_before=obj_bar` in order to + fetch the previous page of the list. + in: query + name: ending_before + required: false + schema: + maxLength: 5000 + type: string + style: form + - description: Specifies which fields in the response should be expanded. + explode: true + in: query + name: expand + required: false + schema: + items: + maxLength: 5000 + type: string + type: array + style: deepObject + - description: >- + A limit on the number of objects to be returned. Limit can range + between 1 and 100, and the default is 10. + in: query + name: limit + required: false + schema: + type: integer + style: form + - description: >- + A cursor for use in pagination. `starting_after` is an object ID + that defines your place in the list. For instance, if you make a + list request and receive 100 objects, ending with `obj_foo`, your + subsequent call can include `starting_after=obj_foo` in order to + fetch the next page of the list. + in: query + name: starting_after + required: false + schema: + maxLength: 5000 + type: string + style: form + - description: >- + Provides a list of customers that are associated with the specified + test clock. The response will not include customers with test clocks + if this parameter is not set. + in: query + name: test_clock + required: false + schema: + maxLength: 5000 + type: string + style: form + responses: + '200': + content: + application/json: + schema: + description: '' + properties: + data: + items: + $ref: '#/components/schemas/customer' + type: array + has_more: + description: >- + True if this list has another page of items after this one + that can be fetched. + type: boolean + object: + description: >- + String representing the object's type. Objects of the same + type share the same value. Always has the value `list`. + enum: + - list + type: string + url: + description: The URL where this list can be accessed. + maxLength: 5000 + pattern: ^/v1/customers + type: string + required: + - data + - has_more + - object + - url + title: CustomerResourceCustomerList + type: object + x-expandableFields: + - data + description: Successful response. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/error' + description: Error response. post: description: "

Creates a new customer object.

" operationId: createCustomer diff --git a/openapi/stripe/types.bal b/openapi/stripe/types.bal index df8519317..18d50342a 100644 --- a/openapi/stripe/types.bal +++ b/openapi/stripe/types.bal @@ -3605,6 +3605,16 @@ public type PaymentIntentNextActionAlipayHandleRedirect record { string? url?; }; +public type CustomerResourceCustomerList record { + Customer[]? data; + # True if this list has another page of items after this one that can be fetched. + boolean? has_more; + # String representing the object's type. Objects of the same type share the same value. Always has the value `list`. + string? 'object; + # The URL where this list can be accessed. + string? url; +}; + # public type PaymentMethodCardWalletSamsungPay record { };