|
1 | 1 | // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
2 | 2 |
|
3 | 3 | import { APIResource } from '../../resource'; |
| 4 | +import * as Core from '../../core'; |
4 | 5 |
|
5 | | -export class AutoOriginTLSKex extends APIResource {} |
| 6 | +export class AutoOriginTLSKex extends APIResource { |
| 7 | + /** |
| 8 | + * Enable or disable Auto-Origin TLS KEX selection for the zone by sending |
| 9 | + * `{"enabled": true}` or `{"enabled": false}`. When enabled, Cloudflare runs a |
| 10 | + * periodic scan of the zone's origins to determine the preferred key-exchange |
| 11 | + * algorithm and writes that preference to the edge so it is sent first in the TLS |
| 12 | + * ClientHello to the origin. |
| 13 | + * |
| 14 | + * @example |
| 15 | + * ```ts |
| 16 | + * const response = await client.ssl.autoOriginTLSKex.edit({ |
| 17 | + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', |
| 18 | + * enabled: true, |
| 19 | + * }); |
| 20 | + * ``` |
| 21 | + */ |
| 22 | + edit( |
| 23 | + params: AutoOriginTLSKexEditParams, |
| 24 | + options?: Core.RequestOptions, |
| 25 | + ): Core.APIPromise<AutoOriginTLSKexEditResponse> { |
| 26 | + const { zone_id, ...body } = params; |
| 27 | + return ( |
| 28 | + this._client.patch(`/zones/${zone_id}/settings/auto_origin_tls_kex`, { |
| 29 | + body, |
| 30 | + ...options, |
| 31 | + }) as Core.APIPromise<{ result: AutoOriginTLSKexEditResponse }> |
| 32 | + )._thenUnwrap((obj) => obj.result); |
| 33 | + } |
| 34 | + |
| 35 | + /** |
| 36 | + * When enabled, Cloudflare automatically selects the preferred TLS key-exchange |
| 37 | + * algorithm to use when establishing the TLS connection to the zone's origin, |
| 38 | + * picking from the algorithms permitted by the zone's |
| 39 | + * `origin_tls_compliance_modes` setting. When disabled, the default key-exchange |
| 40 | + * ordering is used. |
| 41 | + * |
| 42 | + * @example |
| 43 | + * ```ts |
| 44 | + * const autoOriginTLSKex = |
| 45 | + * await client.ssl.autoOriginTLSKex.get({ |
| 46 | + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', |
| 47 | + * }); |
| 48 | + * ``` |
| 49 | + */ |
| 50 | + get( |
| 51 | + params: AutoOriginTLSKexGetParams, |
| 52 | + options?: Core.RequestOptions, |
| 53 | + ): Core.APIPromise<AutoOriginTLSKexGetResponse> { |
| 54 | + const { zone_id } = params; |
| 55 | + return ( |
| 56 | + this._client.get(`/zones/${zone_id}/settings/auto_origin_tls_kex`, options) as Core.APIPromise<{ |
| 57 | + result: AutoOriginTLSKexGetResponse; |
| 58 | + }> |
| 59 | + )._thenUnwrap((obj) => obj.result); |
| 60 | + } |
| 61 | +} |
| 62 | + |
| 63 | +export interface AutoOriginTLSKexEditResponse { |
| 64 | + id: string; |
| 65 | + |
| 66 | + /** |
| 67 | + * Whether Auto-Origin TLS KEX selection is enabled for the zone. |
| 68 | + */ |
| 69 | + enabled: boolean; |
| 70 | + |
| 71 | + /** |
| 72 | + * Last time this setting was modified. |
| 73 | + */ |
| 74 | + modified_on: string; |
| 75 | +} |
| 76 | + |
| 77 | +export interface AutoOriginTLSKexGetResponse { |
| 78 | + id: string; |
| 79 | + |
| 80 | + /** |
| 81 | + * Whether Auto-Origin TLS KEX selection is enabled for the zone. |
| 82 | + */ |
| 83 | + enabled: boolean; |
| 84 | + |
| 85 | + /** |
| 86 | + * Last time this setting was modified. |
| 87 | + */ |
| 88 | + modified_on: string; |
| 89 | +} |
| 90 | + |
| 91 | +export interface AutoOriginTLSKexEditParams { |
| 92 | + /** |
| 93 | + * Path param |
| 94 | + */ |
| 95 | + zone_id: string; |
| 96 | + |
| 97 | + /** |
| 98 | + * Body param: Controls enablement of Auto-Origin TLS KEX selection for the zone. |
| 99 | + */ |
| 100 | + enabled: boolean; |
| 101 | +} |
| 102 | + |
| 103 | +export interface AutoOriginTLSKexGetParams { |
| 104 | + zone_id: string; |
| 105 | +} |
| 106 | + |
| 107 | +export declare namespace AutoOriginTLSKex { |
| 108 | + export { |
| 109 | + type AutoOriginTLSKexEditResponse as AutoOriginTLSKexEditResponse, |
| 110 | + type AutoOriginTLSKexGetResponse as AutoOriginTLSKexGetResponse, |
| 111 | + type AutoOriginTLSKexEditParams as AutoOriginTLSKexEditParams, |
| 112 | + type AutoOriginTLSKexGetParams as AutoOriginTLSKexGetParams, |
| 113 | + }; |
| 114 | +} |
0 commit comments