cloudflare/cloudflare-typescript
Publicmirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable
src/resources/acm/total-tls.ts
103lines · modecode
| 1 | // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | |
| 3 | import * as Core from 'cloudflare/core'; |
| 4 | import { APIResource } from 'cloudflare/resource'; |
| 5 | import * as TotalTLSAPI from 'cloudflare/resources/acm/total-tls'; |
| 6 | |
| 7 | export 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 | export interface TotalTLSCreateResponse { |
| 37 | /** |
| 38 | * The Certificate Authority that Total TLS certificates will be issued through. |
| 39 | */ |
| 40 | certificate_authority?: 'google' | 'lets_encrypt'; |
| 41 | |
| 42 | /** |
| 43 | * If enabled, Total TLS will order a hostname specific TLS certificate for any |
| 44 | * proxied A, AAAA, or CNAME record in your zone. |
| 45 | */ |
| 46 | enabled?: boolean; |
| 47 | |
| 48 | /** |
| 49 | * The validity period in days for the certificates ordered via Total TLS. |
| 50 | */ |
| 51 | validity_days?: 90; |
| 52 | } |
| 53 | |
| 54 | export interface TotalTLSGetResponse { |
| 55 | /** |
| 56 | * The Certificate Authority that Total TLS certificates will be issued through. |
| 57 | */ |
| 58 | certificate_authority?: 'google' | 'lets_encrypt'; |
| 59 | |
| 60 | /** |
| 61 | * If enabled, Total TLS will order a hostname specific TLS certificate for any |
| 62 | * proxied A, AAAA, or CNAME record in your zone. |
| 63 | */ |
| 64 | enabled?: boolean; |
| 65 | |
| 66 | /** |
| 67 | * The validity period in days for the certificates ordered via Total TLS. |
| 68 | */ |
| 69 | validity_days?: 90; |
| 70 | } |
| 71 | |
| 72 | export interface TotalTLSCreateParams { |
| 73 | /** |
| 74 | * Path param: Identifier |
| 75 | */ |
| 76 | zone_id: string; |
| 77 | |
| 78 | /** |
| 79 | * Body param: If enabled, Total TLS will order a hostname specific TLS certificate |
| 80 | * for any proxied A, AAAA, or CNAME record in your zone. |
| 81 | */ |
| 82 | enabled: boolean; |
| 83 | |
| 84 | /** |
| 85 | * Body param: The Certificate Authority that Total TLS certificates will be issued |
| 86 | * through. |
| 87 | */ |
| 88 | certificate_authority?: 'google' | 'lets_encrypt'; |
| 89 | } |
| 90 | |
| 91 | export interface TotalTLSGetParams { |
| 92 | /** |
| 93 | * Identifier |
| 94 | */ |
| 95 | zone_id: string; |
| 96 | } |
| 97 | |
| 98 | export namespace TotalTLS { |
| 99 | export import TotalTLSCreateResponse = TotalTLSAPI.TotalTLSCreateResponse; |
| 100 | export import TotalTLSGetResponse = TotalTLSAPI.TotalTLSGetResponse; |
| 101 | export import TotalTLSCreateParams = TotalTLSAPI.TotalTLSCreateParams; |
| 102 | export import TotalTLSGetParams = TotalTLSAPI.TotalTLSGetParams; |
| 103 | } |
| 104 | |