cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
update-example-structure

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/resources/acm/total-tls.ts

114lines · 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';
5import * as TotalTLSAPI from './total-tls';
6
7export class TotalTLS extends APIResource {
8 /**
9 * Set Total TLS Settings or disable the feature for a Zone.
10 */
11 create(
12 params: TotalTLSCreateParams,
13 options?: Core.RequestOptions,
14 ): Core.APIPromise<TotalTLSCreateResponse> {
15 const { zone_id, ...body } = params;
16 return (
17 this._client.post(`/zones/${zone_id}/acm/total_tls`, { body, ...options }) as Core.APIPromise<{
18 result: TotalTLSCreateResponse;
19 }>
20 )._thenUnwrap((obj) => obj.result);
21 }
22
23 /**
24 * Get Total TLS Settings for a Zone.
25 */
26 get(params: TotalTLSGetParams, options?: Core.RequestOptions): Core.APIPromise<TotalTLSGetResponse> {
27 const { zone_id } = params;
28 return (
29 this._client.get(`/zones/${zone_id}/acm/total_tls`, options) as Core.APIPromise<{
30 result: TotalTLSGetResponse;
31 }>
32 )._thenUnwrap((obj) => obj.result);
33 }
34}
35
36/**
37 * The Certificate Authority that Total TLS certificates will be issued through.
38 */
39export type CertificateAuthority = 'google' | 'lets_encrypt';
40
41/**
42 * The Certificate Authority that Total TLS certificates will be issued through.
43 */
44export type CertificateAuthorityParam = 'google' | 'lets_encrypt';
45
46export interface TotalTLSCreateResponse {
47 /**
48 * The Certificate Authority that Total TLS certificates will be issued through.
49 */
50 certificate_authority?: CertificateAuthority;
51
52 /**
53 * If enabled, Total TLS will order a hostname specific TLS certificate for any
54 * proxied A, AAAA, or CNAME record in your zone.
55 */
56 enabled?: boolean;
57
58 /**
59 * The validity period in days for the certificates ordered via Total TLS.
60 */
61 validity_days?: 90;
62}
63
64export interface TotalTLSGetResponse {
65 /**
66 * The Certificate Authority that Total TLS certificates will be issued through.
67 */
68 certificate_authority?: CertificateAuthority;
69
70 /**
71 * If enabled, Total TLS will order a hostname specific TLS certificate for any
72 * proxied A, AAAA, or CNAME record in your zone.
73 */
74 enabled?: boolean;
75
76 /**
77 * The validity period in days for the certificates ordered via Total TLS.
78 */
79 validity_days?: 90;
80}
81
82export interface TotalTLSCreateParams {
83 /**
84 * Path param: Identifier
85 */
86 zone_id: string;
87
88 /**
89 * Body param: If enabled, Total TLS will order a hostname specific TLS certificate
90 * for any proxied A, AAAA, or CNAME record in your zone.
91 */
92 enabled: boolean;
93
94 /**
95 * Body param: The Certificate Authority that Total TLS certificates will be issued
96 * through.
97 */
98 certificate_authority?: CertificateAuthorityParam;
99}
100
101export interface TotalTLSGetParams {
102 /**
103 * Identifier
104 */
105 zone_id: string;
106}
107
108export namespace TotalTLS {
109 export import CertificateAuthority = TotalTLSAPI.CertificateAuthority;
110 export import TotalTLSCreateResponse = TotalTLSAPI.TotalTLSCreateResponse;
111 export import TotalTLSGetResponse = TotalTLSAPI.TotalTLSGetResponse;
112 export import TotalTLSCreateParams = TotalTLSAPI.TotalTLSCreateParams;
113 export import TotalTLSGetParams = TotalTLSAPI.TotalTLSGetParams;
114}
115