cloudflare/cloudflare-typescript

Public

mirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
next

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/resources/acm/total-tls.ts

189lines · modecode

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