cloudflare/cloudflare-typescript

Public

mirrored from https://github.com/cloudflare/cloudflare-typescriptAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v6.0.0-beta.2

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/resources/acm/total-tls.ts

198lines · modecode

1// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
3import { APIResource } from '../../resource';
4import { isRequestOptions } from '../../core';
5import * as Core from '../../core';
6
7export class TotalTLS extends APIResource {
8 /**
9 * Set Total TLS Settings or disable the feature for a Zone.
10 *
11 * @example
12 * ```ts
13 * const totalTLS = await client.acm.totalTLS.update({
14 * zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
15 * enabled: true,
16 * });
17 * ```
18 */
19 update(
20 params: TotalTLSUpdateParams,
21 options?: Core.RequestOptions,
22 ): Core.APIPromise<TotalTLSUpdateResponse> {
23 const { zone_id = this._client.zoneId, ...body } = params;
24 return (
25 this._client.post(`/zones/${zone_id}/acm/total_tls`, { body, ...options }) as Core.APIPromise<{
26 result: TotalTLSUpdateResponse;
27 }>
28 )._thenUnwrap((obj) => obj.result);
29 }
30
31 /**
32 * Set Total TLS Settings or disable the feature for a Zone.
33 *
34 * @example
35 * ```ts
36 * const response = await client.acm.totalTLS.edit({
37 * zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
38 * enabled: true,
39 * });
40 * ```
41 */
42 edit(params: TotalTLSEditParams, options?: Core.RequestOptions): Core.APIPromise<TotalTLSEditResponse> {
43 const { zone_id = this._client.zoneId, ...body } = params;
44 return (
45 this._client.post(`/zones/${zone_id}/acm/total_tls`, { body, ...options }) as Core.APIPromise<{
46 result: TotalTLSEditResponse;
47 }>
48 )._thenUnwrap((obj) => obj.result);
49 }
50
51 /**
52 * Get Total TLS Settings for a Zone.
53 *
54 * @example
55 * ```ts
56 * const totalTLS = await client.acm.totalTLS.get({
57 * zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
58 * });
59 * ```
60 */
61 get(params?: TotalTLSGetParams, options?: Core.RequestOptions): Core.APIPromise<TotalTLSGetResponse>;
62 get(options?: Core.RequestOptions): Core.APIPromise<TotalTLSGetResponse>;
63 get(
64 params: TotalTLSGetParams | Core.RequestOptions = {},
65 options?: Core.RequestOptions,
66 ): Core.APIPromise<TotalTLSGetResponse> {
67 if (isRequestOptions(params)) {
68 return this.get({}, params);
69 }
70 const { zone_id = this._client.zoneId } = params;
71 return (
72 this._client.get(`/zones/${zone_id}/acm/total_tls`, options) as Core.APIPromise<{
73 result: TotalTLSGetResponse;
74 }>
75 )._thenUnwrap((obj) => obj.result);
76 }
77}
78
79/**
80 * The Certificate Authority that Total TLS certificates will be issued through.
81 */
82export type CertificateAuthority = 'google' | 'lets_encrypt' | 'ssl_com';
83
84/**
85 * The Certificate Authority that Total TLS certificates will be issued through.
86 */
87export type CertificateAuthorityParam = 'google' | 'lets_encrypt' | 'ssl_com';
88
89export interface TotalTLSUpdateResponse {
90 /**
91 * The Certificate Authority that Total TLS certificates will be issued through.
92 */
93 certificate_authority?: CertificateAuthority;
94
95 /**
96 * If enabled, Total TLS will order a hostname specific TLS certificate for any
97 * proxied A, AAAA, or CNAME record in your zone.
98 */
99 enabled?: boolean;
100
101 /**
102 * The validity period in days for the certificates ordered via Total TLS.
103 */
104 validity_period?: 90;
105}
106
107export interface TotalTLSEditResponse {
108 /**
109 * The Certificate Authority that Total TLS certificates will be issued through.
110 */
111 certificate_authority?: CertificateAuthority;
112
113 /**
114 * If enabled, Total TLS will order a hostname specific TLS certificate for any
115 * proxied A, AAAA, or CNAME record in your zone.
116 */
117 enabled?: boolean;
118
119 /**
120 * The validity period in days for the certificates ordered via Total TLS.
121 */
122 validity_period?: 90;
123}
124
125export interface TotalTLSGetResponse {
126 /**
127 * The Certificate Authority that Total TLS certificates will be issued through.
128 */
129 certificate_authority?: CertificateAuthority;
130
131 /**
132 * If enabled, Total TLS will order a hostname specific TLS certificate for any
133 * proxied A, AAAA, or CNAME record in your zone.
134 */
135 enabled?: boolean;
136
137 /**
138 * The validity period in days for the certificates ordered via Total TLS.
139 */
140 validity_period?: 90;
141}
142
143export interface TotalTLSUpdateParams {
144 /**
145 * Path param: Identifier.
146 */
147 zone_id?: string;
148
149 /**
150 * Body param: If enabled, Total TLS will order a hostname specific TLS certificate
151 * for any proxied A, AAAA, or CNAME record in your zone.
152 */
153 enabled: boolean;
154
155 /**
156 * Body param: The Certificate Authority that Total TLS certificates will be issued
157 * through.
158 */
159 certificate_authority?: CertificateAuthorityParam;
160}
161
162export interface TotalTLSEditParams {
163 /**
164 * Path param: Identifier.
165 */
166 zone_id?: string;
167
168 /**
169 * Body param: If enabled, Total TLS will order a hostname specific TLS certificate
170 * for any proxied A, AAAA, or CNAME record in your zone.
171 */
172 enabled: boolean;
173
174 /**
175 * Body param: The Certificate Authority that Total TLS certificates will be issued
176 * through.
177 */
178 certificate_authority?: CertificateAuthorityParam;
179}
180
181export interface TotalTLSGetParams {
182 /**
183 * Identifier.
184 */
185 zone_id?: string;
186}
187
188export declare namespace TotalTLS {
189 export {
190 type CertificateAuthority as CertificateAuthority,
191 type TotalTLSUpdateResponse as TotalTLSUpdateResponse,
192 type TotalTLSEditResponse as TotalTLSEditResponse,
193 type TotalTLSGetResponse as TotalTLSGetResponse,
194 type TotalTLSUpdateParams as TotalTLSUpdateParams,
195 type TotalTLSEditParams as TotalTLSEditParams,
196 type TotalTLSGetParams as TotalTLSGetParams,
197 };
198}
199