Skip to content

Commit

Permalink
feat: update via SDK Studio (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Feb 16, 2024
1 parent 24b7540 commit 63bfebd
Show file tree
Hide file tree
Showing 48 changed files with 421 additions and 460 deletions.
74 changes: 37 additions & 37 deletions api.md

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,11 @@ export namespace Cloudflare {
export import AccountListParams = API.AccountListParams;

export import Certificates = API.Certificates;
export import CertificateCreateResponse = API.CertificateCreateResponse;
export import CertificateListResponse = API.CertificateListResponse;
export import CertificateDeleteResponse = API.CertificateDeleteResponse;
export import CertificateGetResponse = API.CertificateGetResponse;
export import CertificateOriginCaCreateCertificateResponse = API.CertificateOriginCaCreateCertificateResponse;
export import CertificateOriginCaListCertificatesResponse = API.CertificateOriginCaListCertificatesResponse;
export import CertificateOriginCaCreateCertificateParams = API.CertificateOriginCaCreateCertificateParams;
export import CertificateCreateParams = API.CertificateCreateParams;

export import IPs = API.IPs;
export import IPListResponse = API.IPListResponse;
Expand Down Expand Up @@ -419,16 +419,16 @@ export namespace Cloudflare {
export import SSLs = API.SSLs;

export import Subscriptions = API.Subscriptions;
export import SubscriptionCreateResponse = API.SubscriptionCreateResponse;
export import SubscriptionUpdateResponse = API.SubscriptionUpdateResponse;
export import SubscriptionDeleteResponse = API.SubscriptionDeleteResponse;
export import SubscriptionAccountSubscriptionsCreateSubscriptionResponse = API.SubscriptionAccountSubscriptionsCreateSubscriptionResponse;
export import SubscriptionAccountSubscriptionsListSubscriptionsResponse = API.SubscriptionAccountSubscriptionsListSubscriptionsResponse;
export import SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse = API.SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse;
export import SubscriptionGetResponse = API.SubscriptionGetResponse;
export import SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponse = API.SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponse;
export import SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse = API.SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse;
export import SubscriptionCreateParams = API.SubscriptionCreateParams;
export import SubscriptionUpdateParams = API.SubscriptionUpdateParams;
export import SubscriptionAccountSubscriptionsCreateSubscriptionParams = API.SubscriptionAccountSubscriptionsCreateSubscriptionParams;
export import SubscriptionZoneSubscriptionCreateZoneSubscriptionParams = API.SubscriptionZoneSubscriptionCreateZoneSubscriptionParams;
export import SubscriptionZoneSubscriptionUpdateZoneSubscriptionParams = API.SubscriptionZoneSubscriptionUpdateZoneSubscriptionParams;

export import Acms = API.Acms;
Expand Down Expand Up @@ -666,11 +666,11 @@ export namespace Cloudflare {
export import Mnms = API.Mnms;

export import MtlsCertificates = API.MtlsCertificates;
export import MtlsCertificateUpdateResponse = API.MtlsCertificateUpdateResponse;
export import MtlsCertificateCreateResponse = API.MtlsCertificateCreateResponse;
export import MtlsCertificateListResponse = API.MtlsCertificateListResponse;
export import MtlsCertificateDeleteResponse = API.MtlsCertificateDeleteResponse;
export import MtlsCertificateGetResponse = API.MtlsCertificateGetResponse;
export import MtlsCertificateUpdateParams = API.MtlsCertificateUpdateParams;
export import MtlsCertificateCreateParams = API.MtlsCertificateCreateParams;

export import Pages = API.Pages;

Expand All @@ -693,10 +693,10 @@ export namespace Cloudflare {
export import Storage = API.Storage;

export import Stream = API.Stream;
export import StreamUpdateResponse = API.StreamUpdateResponse;
export import StreamCreateResponse = API.StreamCreateResponse;
export import StreamGetResponse = API.StreamGetResponse;
export import StreamStreamVideosListVideosResponse = API.StreamStreamVideosListVideosResponse;
export import StreamUpdateParams = API.StreamUpdateParams;
export import StreamCreateParams = API.StreamCreateParams;
export import StreamStreamVideosInitiateVideoUploadsUsingTusParams = API.StreamStreamVideosInitiateVideoUploadsUsingTusParams;
export import StreamStreamVideosListVideosParams = API.StreamStreamVideosListVideosParams;

Expand Down
15 changes: 7 additions & 8 deletions src/resources/access/users/failed-logins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,30 @@ export class FailedLogins extends APIResource {
/**
* Get all failed login attempts for a single user.
*/
zeroTrustUsersGetFailedLogins(
get(
identifier: string,
id: string,
options?: Core.RequestOptions,
): Core.APIPromise<FailedLoginZeroTrustUsersGetFailedLoginsResponse | null> {
): Core.APIPromise<FailedLoginGetResponse | null> {
return (
this._client.get(
`/accounts/${identifier}/access/users/${id}/failed_logins`,
options,
) as Core.APIPromise<{ result: FailedLoginZeroTrustUsersGetFailedLoginsResponse | null }>
) as Core.APIPromise<{ result: FailedLoginGetResponse | null }>
)._thenUnwrap((obj) => obj.result);
}
}

export type FailedLoginZeroTrustUsersGetFailedLoginsResponse =
Array<FailedLoginZeroTrustUsersGetFailedLoginsResponse.FailedLoginZeroTrustUsersGetFailedLoginsResponseItem>;
export type FailedLoginGetResponse = Array<FailedLoginGetResponse.FailedLoginGetResponseItem>;

export namespace FailedLoginZeroTrustUsersGetFailedLoginsResponse {
export interface FailedLoginZeroTrustUsersGetFailedLoginsResponseItem {
export namespace FailedLoginGetResponse {
export interface FailedLoginGetResponseItem {
expiration?: number;

metadata?: unknown;
}
}

export namespace FailedLogins {
export import FailedLoginZeroTrustUsersGetFailedLoginsResponse = FailedLoginsAPI.FailedLoginZeroTrustUsersGetFailedLoginsResponse;
export import FailedLoginGetResponse = FailedLoginsAPI.FailedLoginGetResponse;
}
2 changes: 1 addition & 1 deletion src/resources/access/users/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.

export { ActiveSessionListResponse, ActiveSessionGetResponse, ActiveSessions } from './active-sessions';
export { FailedLoginZeroTrustUsersGetFailedLoginsResponse, FailedLogins } from './failed-logins';
export { FailedLoginGetResponse, FailedLogins } from './failed-logins';
export { LastSeenIdentityGetResponse, LastSeenIdentity } from './last-seen-identity';
export { UserListResponse, Users } from './users';
2 changes: 1 addition & 1 deletion src/resources/access/users/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,5 @@ export namespace Users {
export import LastSeenIdentity = LastSeenIdentityAPI.LastSeenIdentity;
export import LastSeenIdentityGetResponse = LastSeenIdentityAPI.LastSeenIdentityGetResponse;
export import FailedLogins = FailedLoginsAPI.FailedLogins;
export import FailedLoginZeroTrustUsersGetFailedLoginsResponse = FailedLoginsAPI.FailedLoginZeroTrustUsersGetFailedLoginsResponse;
export import FailedLoginGetResponse = FailedLoginsAPI.FailedLoginGetResponse;
}
4 changes: 2 additions & 2 deletions src/resources/acms/acms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class Acms extends APIResource {

export namespace Acms {
export import TotalTLS = TotalTLSAPI.TotalTLS;
export import TotalTLSUpdateResponse = TotalTLSAPI.TotalTLSUpdateResponse;
export import TotalTLSCreateResponse = TotalTLSAPI.TotalTLSCreateResponse;
export import TotalTLSGetResponse = TotalTLSAPI.TotalTLSGetResponse;
export import TotalTLSUpdateParams = TotalTLSAPI.TotalTLSUpdateParams;
export import TotalTLSCreateParams = TotalTLSAPI.TotalTLSCreateParams;
}
2 changes: 1 addition & 1 deletion src/resources/acms/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// File generated from our OpenAPI spec by Stainless.

export { Acms } from './acms';
export { TotalTLSUpdateResponse, TotalTLSGetResponse, TotalTLSUpdateParams, TotalTLS } from './total-tls';
export { TotalTLSCreateResponse, TotalTLSGetResponse, TotalTLSCreateParams, TotalTLS } from './total-tls';
16 changes: 8 additions & 8 deletions src/resources/acms/total-tls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ export class TotalTLS extends APIResource {
/**
* Set Total TLS Settings or disable the feature for a Zone.
*/
update(
create(
zoneId: string,
body: TotalTLSUpdateParams,
body: TotalTLSCreateParams,
options?: Core.RequestOptions,
): Core.APIPromise<TotalTLSUpdateResponse> {
): Core.APIPromise<TotalTLSCreateResponse> {
return (
this._client.post(`/zones/${zoneId}/acm/total_tls`, { body, ...options }) as Core.APIPromise<{
result: TotalTLSUpdateResponse;
result: TotalTLSCreateResponse;
}>
)._thenUnwrap((obj) => obj.result);
}
Expand All @@ -32,7 +32,7 @@ export class TotalTLS extends APIResource {
}
}

export interface TotalTLSUpdateResponse {
export interface TotalTLSCreateResponse {
/**
* The Certificate Authority that Total TLS certificates will be issued through.
*/
Expand Down Expand Up @@ -68,7 +68,7 @@ export interface TotalTLSGetResponse {
validity_days?: 90;
}

export interface TotalTLSUpdateParams {
export interface TotalTLSCreateParams {
/**
* If enabled, Total TLS will order a hostname specific TLS certificate for any
* proxied A, AAAA, or CNAME record in your zone.
Expand All @@ -82,7 +82,7 @@ export interface TotalTLSUpdateParams {
}

export namespace TotalTLS {
export import TotalTLSUpdateResponse = TotalTLSAPI.TotalTLSUpdateResponse;
export import TotalTLSCreateResponse = TotalTLSAPI.TotalTLSCreateResponse;
export import TotalTLSGetResponse = TotalTLSAPI.TotalTLSGetResponse;
export import TotalTLSUpdateParams = TotalTLSAPI.TotalTLSUpdateParams;
export import TotalTLSCreateParams = TotalTLSAPI.TotalTLSCreateParams;
}
81 changes: 39 additions & 42 deletions src/resources/certificates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,78 +6,66 @@ import * as CertificatesAPI from 'cloudflare/resources/certificates';

export class Certificates extends APIResource {
/**
* Revoke an existing Origin CA certificate by its serial number. Use your Origin
* CA Key as your User Service Key when calling this endpoint
* ([see above](#requests)).
* Create an Origin CA certificate. Use your Origin CA Key as your User Service Key
* when calling this endpoint ([see above](#requests)).
*/
delete(certificateId: string, options?: Core.RequestOptions): Core.APIPromise<CertificateDeleteResponse> {
create(
body: CertificateCreateParams,
options?: Core.RequestOptions,
): Core.APIPromise<CertificateCreateResponse> {
return (
this._client.delete(`/certificates/${certificateId}`, options) as Core.APIPromise<{
result: CertificateDeleteResponse;
this._client.post('/certificates', { body, ...options }) as Core.APIPromise<{
result: CertificateCreateResponse;
}>
)._thenUnwrap((obj) => obj.result);
}

/**
* Get an existing Origin CA certificate by its serial number. Use your Origin CA
* List all existing Origin CA certificates for a given zone. Use your Origin CA
* Key as your User Service Key when calling this endpoint
* ([see above](#requests)).
*/
get(certificateId: string, options?: Core.RequestOptions): Core.APIPromise<CertificateGetResponse> {
list(options?: Core.RequestOptions): Core.APIPromise<CertificateListResponse | null> {
return (
this._client.get(`/certificates/${certificateId}`, options) as Core.APIPromise<{
result: CertificateGetResponse;
this._client.get('/certificates', options) as Core.APIPromise<{
result: CertificateListResponse | null;
}>
)._thenUnwrap((obj) => obj.result);
}

/**
* Create an Origin CA certificate. Use your Origin CA Key as your User Service Key
* when calling this endpoint ([see above](#requests)).
* Revoke an existing Origin CA certificate by its serial number. Use your Origin
* CA Key as your User Service Key when calling this endpoint
* ([see above](#requests)).
*/
originCaCreateCertificate(
body: CertificateOriginCaCreateCertificateParams,
options?: Core.RequestOptions,
): Core.APIPromise<CertificateOriginCaCreateCertificateResponse> {
delete(certificateId: string, options?: Core.RequestOptions): Core.APIPromise<CertificateDeleteResponse> {
return (
this._client.post('/certificates', { body, ...options }) as Core.APIPromise<{
result: CertificateOriginCaCreateCertificateResponse;
this._client.delete(`/certificates/${certificateId}`, options) as Core.APIPromise<{
result: CertificateDeleteResponse;
}>
)._thenUnwrap((obj) => obj.result);
}

/**
* List all existing Origin CA certificates for a given zone. Use your Origin CA
* Get an existing Origin CA certificate by its serial number. Use your Origin CA
* Key as your User Service Key when calling this endpoint
* ([see above](#requests)).
*/
originCaListCertificates(
options?: Core.RequestOptions,
): Core.APIPromise<CertificateOriginCaListCertificatesResponse | null> {
get(certificateId: string, options?: Core.RequestOptions): Core.APIPromise<CertificateGetResponse> {
return (
this._client.get('/certificates', options) as Core.APIPromise<{
result: CertificateOriginCaListCertificatesResponse | null;
this._client.get(`/certificates/${certificateId}`, options) as Core.APIPromise<{
result: CertificateGetResponse;
}>
)._thenUnwrap((obj) => obj.result);
}
}

export interface CertificateDeleteResponse {
/**
* Identifier
*/
id?: string;
}
export type CertificateCreateResponse = unknown | string;

export type CertificateGetResponse = unknown | string;

export type CertificateOriginCaCreateCertificateResponse = unknown | string;

export type CertificateOriginCaListCertificatesResponse =
Array<CertificateOriginCaListCertificatesResponse.CertificateOriginCaListCertificatesResponseItem>;
export type CertificateListResponse = Array<CertificateListResponse.CertificateListResponseItem>;

export namespace CertificateOriginCaListCertificatesResponse {
export interface CertificateOriginCaListCertificatesResponseItem {
export namespace CertificateListResponse {
export interface CertificateListResponseItem {
/**
* The Certificate Signing Request (CSR). Must be newline-encoded.
*/
Expand Down Expand Up @@ -117,7 +105,16 @@ export namespace CertificateOriginCaListCertificatesResponse {
}
}

export interface CertificateOriginCaCreateCertificateParams {
export interface CertificateDeleteResponse {
/**
* Identifier
*/
id?: string;
}

export type CertificateGetResponse = unknown | string;

export interface CertificateCreateParams {
/**
* The Certificate Signing Request (CSR). Must be newline-encoded.
*/
Expand All @@ -142,9 +139,9 @@ export interface CertificateOriginCaCreateCertificateParams {
}

export namespace Certificates {
export import CertificateCreateResponse = CertificatesAPI.CertificateCreateResponse;
export import CertificateListResponse = CertificatesAPI.CertificateListResponse;
export import CertificateDeleteResponse = CertificatesAPI.CertificateDeleteResponse;
export import CertificateGetResponse = CertificatesAPI.CertificateGetResponse;
export import CertificateOriginCaCreateCertificateResponse = CertificatesAPI.CertificateOriginCaCreateCertificateResponse;
export import CertificateOriginCaListCertificatesResponse = CertificatesAPI.CertificateOriginCaListCertificatesResponse;
export import CertificateOriginCaCreateCertificateParams = CertificatesAPI.CertificateOriginCaCreateCertificateParams;
export import CertificateCreateParams = CertificatesAPI.CertificateCreateParams;
}
2 changes: 1 addition & 1 deletion src/resources/custom-ns/custom-ns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,5 +166,5 @@ export namespace CustomNs {
export import Availabilities = AvailabilitiesAPI.Availabilities;
export import AvailabilityGetResponse = AvailabilitiesAPI.AvailabilityGetResponse;
export import Verifies = VerifiesAPI.Verifies;
export import VerifyUpdateResponse = VerifiesAPI.VerifyUpdateResponse;
export import VerifyCreateResponse = VerifiesAPI.VerifyCreateResponse;
}
2 changes: 1 addition & 1 deletion src/resources/custom-ns/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export {
CustomNCreateParams,
CustomNs,
} from './custom-ns';
export { VerifyUpdateResponse, Verifies } from './verifies';
export { VerifyCreateResponse, Verifies } from './verifies';
16 changes: 8 additions & 8 deletions src/resources/custom-ns/verifies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ export class Verifies extends APIResource {
/**
* Verify Account Custom Nameserver Glue Records
*/
update(accountId: string, options?: Core.RequestOptions): Core.APIPromise<VerifyUpdateResponse | null> {
create(accountId: string, options?: Core.RequestOptions): Core.APIPromise<VerifyCreateResponse | null> {
return (
this._client.post(`/accounts/${accountId}/custom_ns/verify`, options) as Core.APIPromise<{
result: VerifyUpdateResponse | null;
result: VerifyCreateResponse | null;
}>
)._thenUnwrap((obj) => obj.result);
}
}

export type VerifyUpdateResponse = Array<VerifyUpdateResponse.VerifyUpdateResponseItem>;
export type VerifyCreateResponse = Array<VerifyCreateResponse.VerifyCreateResponseItem>;

export namespace VerifyUpdateResponse {
export namespace VerifyCreateResponse {
/**
* A single account custom nameserver.
*/
export interface VerifyUpdateResponseItem {
export interface VerifyCreateResponseItem {
/**
* A and AAAA records associated with the nameserver.
*/
dns_records: Array<VerifyUpdateResponseItem.DNSRecord>;
dns_records: Array<VerifyCreateResponseItem.DNSRecord>;

/**
* The FQDN of the name server.
Expand All @@ -50,7 +50,7 @@ export namespace VerifyUpdateResponse {
ns_set?: number;
}

export namespace VerifyUpdateResponseItem {
export namespace VerifyCreateResponseItem {
export interface DNSRecord {
/**
* DNS record type.
Expand All @@ -66,5 +66,5 @@ export namespace VerifyUpdateResponse {
}

export namespace Verifies {
export import VerifyUpdateResponse = VerifiesAPI.VerifyUpdateResponse;
export import VerifyCreateResponse = VerifiesAPI.VerifyCreateResponse;
}
Loading

0 comments on commit 63bfebd

Please sign in to comment.