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

feat: update via SDK Studio #4

Merged
merged 1 commit into from
Feb 16, 2024
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
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 CertificateCreateParams = API.CertificateCreateParams;
export import CertificateOriginCaCreateCertificateResponse = API.CertificateOriginCaCreateCertificateResponse;
export import CertificateOriginCaListCertificatesResponse = API.CertificateOriginCaListCertificatesResponse;
export import CertificateOriginCaCreateCertificateParams = API.CertificateOriginCaCreateCertificateParams;

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 SubscriptionGetResponse = API.SubscriptionGetResponse;
export import SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse = API.SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse;
export import SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponse = API.SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponse;
export import SubscriptionCreateParams = API.SubscriptionCreateParams;
export import SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse = API.SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse;
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 MtlsCertificateCreateResponse = API.MtlsCertificateCreateResponse;
export import MtlsCertificateUpdateResponse = API.MtlsCertificateUpdateResponse;
export import MtlsCertificateListResponse = API.MtlsCertificateListResponse;
export import MtlsCertificateDeleteResponse = API.MtlsCertificateDeleteResponse;
export import MtlsCertificateGetResponse = API.MtlsCertificateGetResponse;
export import MtlsCertificateCreateParams = API.MtlsCertificateCreateParams;
export import MtlsCertificateUpdateParams = API.MtlsCertificateUpdateParams;

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 StreamCreateResponse = API.StreamCreateResponse;
export import StreamUpdateResponse = API.StreamUpdateResponse;
export import StreamGetResponse = API.StreamGetResponse;
export import StreamStreamVideosListVideosResponse = API.StreamStreamVideosListVideosResponse;
export import StreamCreateParams = API.StreamCreateParams;
export import StreamUpdateParams = API.StreamUpdateParams;
export import StreamStreamVideosInitiateVideoUploadsUsingTusParams = API.StreamStreamVideosInitiateVideoUploadsUsingTusParams;
export import StreamStreamVideosListVideosParams = API.StreamStreamVideosListVideosParams;

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

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

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

metadata?: unknown;
}
}

export namespace FailedLogins {
export import FailedLoginGetResponse = FailedLoginsAPI.FailedLoginGetResponse;
export import FailedLoginZeroTrustUsersGetFailedLoginsResponse = FailedLoginsAPI.FailedLoginZeroTrustUsersGetFailedLoginsResponse;
}
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 { FailedLoginGetResponse, FailedLogins } from './failed-logins';
export { FailedLoginZeroTrustUsersGetFailedLoginsResponse, 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 FailedLoginGetResponse = FailedLoginsAPI.FailedLoginGetResponse;
export import FailedLoginZeroTrustUsersGetFailedLoginsResponse = FailedLoginsAPI.FailedLoginZeroTrustUsersGetFailedLoginsResponse;
}
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 TotalTLSCreateResponse = TotalTLSAPI.TotalTLSCreateResponse;
export import TotalTLSUpdateResponse = TotalTLSAPI.TotalTLSUpdateResponse;
export import TotalTLSGetResponse = TotalTLSAPI.TotalTLSGetResponse;
export import TotalTLSCreateParams = TotalTLSAPI.TotalTLSCreateParams;
export import TotalTLSUpdateParams = TotalTLSAPI.TotalTLSUpdateParams;
}
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 { TotalTLSCreateResponse, TotalTLSGetResponse, TotalTLSCreateParams, TotalTLS } from './total-tls';
export { TotalTLSUpdateResponse, TotalTLSGetResponse, TotalTLSUpdateParams, 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.
*/
create(
update(
zoneId: string,
body: TotalTLSCreateParams,
body: TotalTLSUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<TotalTLSCreateResponse> {
): Core.APIPromise<TotalTLSUpdateResponse> {
return (
this._client.post(`/zones/${zoneId}/acm/total_tls`, { body, ...options }) as Core.APIPromise<{
result: TotalTLSCreateResponse;
result: TotalTLSUpdateResponse;
}>
)._thenUnwrap((obj) => obj.result);
}
Expand All @@ -32,7 +32,7 @@ export class TotalTLS extends APIResource {
}
}

export interface TotalTLSCreateResponse {
export interface TotalTLSUpdateResponse {
/**
* 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 TotalTLSCreateParams {
export interface TotalTLSUpdateParams {
/**
* 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 TotalTLSCreateParams {
}

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

export class Certificates extends APIResource {
/**
* 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)).
*/
create(
body: CertificateCreateParams,
options?: Core.RequestOptions,
): Core.APIPromise<CertificateCreateResponse> {
delete(certificateId: string, options?: Core.RequestOptions): Core.APIPromise<CertificateDeleteResponse> {
return (
this._client.post('/certificates', { body, ...options }) as Core.APIPromise<{
result: CertificateCreateResponse;
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)).
*/
list(options?: Core.RequestOptions): Core.APIPromise<CertificateListResponse | null> {
get(certificateId: string, options?: Core.RequestOptions): Core.APIPromise<CertificateGetResponse> {
return (
this._client.get('/certificates', options) as Core.APIPromise<{
result: CertificateListResponse | null;
this._client.get(`/certificates/${certificateId}`, options) as Core.APIPromise<{
result: CertificateGetResponse;
}>
)._thenUnwrap((obj) => obj.result);
}

/**
* 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> {
originCaCreateCertificate(
body: CertificateOriginCaCreateCertificateParams,
options?: Core.RequestOptions,
): Core.APIPromise<CertificateOriginCaCreateCertificateResponse> {
return (
this._client.delete(`/certificates/${certificateId}`, options) as Core.APIPromise<{
result: CertificateDeleteResponse;
this._client.post('/certificates', { body, ...options }) as Core.APIPromise<{
result: CertificateOriginCaCreateCertificateResponse;
}>
)._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> {
originCaListCertificates(
options?: Core.RequestOptions,
): Core.APIPromise<CertificateOriginCaListCertificatesResponse | null> {
return (
this._client.get(`/certificates/${certificateId}`, options) as Core.APIPromise<{
result: CertificateGetResponse;
this._client.get('/certificates', options) as Core.APIPromise<{
result: CertificateOriginCaListCertificatesResponse | null;
}>
)._thenUnwrap((obj) => obj.result);
}
}

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

export type CertificateListResponse = Array<CertificateListResponse.CertificateListResponseItem>;
export type CertificateGetResponse = unknown | string;

export type CertificateOriginCaCreateCertificateResponse = unknown | string;

export type CertificateOriginCaListCertificatesResponse =
Array<CertificateOriginCaListCertificatesResponse.CertificateOriginCaListCertificatesResponseItem>;

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

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

export type CertificateGetResponse = unknown | string;

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

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 CertificateCreateParams = CertificatesAPI.CertificateCreateParams;
export import CertificateOriginCaCreateCertificateResponse = CertificatesAPI.CertificateOriginCaCreateCertificateResponse;
export import CertificateOriginCaListCertificatesResponse = CertificatesAPI.CertificateOriginCaListCertificatesResponse;
export import CertificateOriginCaCreateCertificateParams = CertificatesAPI.CertificateOriginCaCreateCertificateParams;
}
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 VerifyCreateResponse = VerifiesAPI.VerifyCreateResponse;
export import VerifyUpdateResponse = VerifiesAPI.VerifyUpdateResponse;
}
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 { VerifyCreateResponse, Verifies } from './verifies';
export { VerifyUpdateResponse, 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
*/
create(accountId: string, options?: Core.RequestOptions): Core.APIPromise<VerifyCreateResponse | null> {
update(accountId: string, options?: Core.RequestOptions): Core.APIPromise<VerifyUpdateResponse | null> {
return (
this._client.post(`/accounts/${accountId}/custom_ns/verify`, options) as Core.APIPromise<{
result: VerifyCreateResponse | null;
result: VerifyUpdateResponse | null;
}>
)._thenUnwrap((obj) => obj.result);
}
}

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

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

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

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

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