-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): update internal path (#2396)
- Loading branch information
1 parent
4ee3552
commit 6948a0b
Showing
6 changed files
with
89 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
configured_endpoints: 1524 | ||
configured_endpoints: 1525 | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-201a9d77b2e238cb2f8c2c952b00b976608e2a53fe4230369e801971fda29edc.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,46 @@ | ||
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
import { APIResource } from '../../resource'; | ||
import * as Core from '../../core'; | ||
|
||
export class Recommendations extends APIResource {} | ||
export class Recommendations extends APIResource { | ||
/** | ||
* Retrieve the SSL/TLS Recommender's recommendation for a zone. | ||
*/ | ||
get( | ||
params: RecommendationGetParams, | ||
options?: Core.RequestOptions, | ||
): Core.APIPromise<RecommendationGetResponse> { | ||
const { zone_id } = params; | ||
return ( | ||
this._client.get(`/zones/${zone_id}/ssl/recommendation`, options) as Core.APIPromise<{ | ||
result: RecommendationGetResponse; | ||
}> | ||
)._thenUnwrap((obj) => obj.result); | ||
} | ||
} | ||
|
||
export interface RecommendationGetResponse { | ||
/** | ||
* Identifier of a recommendation result. | ||
*/ | ||
id?: string; | ||
|
||
modified_on?: string; | ||
|
||
value?: 'flexible' | 'full' | 'strict'; | ||
} | ||
|
||
export interface RecommendationGetParams { | ||
/** | ||
* Identifier | ||
*/ | ||
zone_id: string; | ||
} | ||
|
||
export declare namespace Recommendations { | ||
export { | ||
type RecommendationGetResponse as RecommendationGetResponse, | ||
type RecommendationGetParams as RecommendationGetParams, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
import Cloudflare from 'cloudflare'; | ||
import { Response } from 'node-fetch'; | ||
|
||
const client = new Cloudflare({ | ||
apiKey: '144c9defac04969c7bfad8efaa8ea194', | ||
apiEmail: '[email protected]', | ||
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', | ||
}); | ||
|
||
describe('resource recommendations', () => { | ||
test('get: only required params', async () => { | ||
const responsePromise = client.ssl.recommendations.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); | ||
const rawResponse = await responsePromise.asResponse(); | ||
expect(rawResponse).toBeInstanceOf(Response); | ||
const response = await responsePromise; | ||
expect(response).not.toBeInstanceOf(Response); | ||
const dataAndResponse = await responsePromise.withResponse(); | ||
expect(dataAndResponse.data).toBe(response); | ||
expect(dataAndResponse.response).toBe(rawResponse); | ||
}); | ||
|
||
test('get: required and optional params', async () => { | ||
const response = await client.ssl.recommendations.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); | ||
}); | ||
}); |