cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v4.0.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/resources/acm/total-tls.ts

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