Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): remap models for magic visibility #2107

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 21 additions & 36 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2485,16 +2485,14 @@ Methods:

Types:

- <code><a href="./src/resources/rulesets/versions/versions.ts">VersionListResponse</a></code>
- <code><a href="./src/resources/rulesets/versions/versions.ts">VersionGetResponse</a></code>
- <code><a href="./src/resources/rulesets/versions.ts">VersionListResponse</a></code>
- <code><a href="./src/resources/rulesets/versions.ts">VersionGetResponse</a></code>

Methods:

- <code title="get /{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/versions">client.rulesets.versions.<a href="./src/resources/rulesets/versions/versions.ts">list</a>(rulesetId, { ...params }) -> VersionListResponsesSinglePage</code>
- <code title="delete /{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/versions/{ruleset_version}">client.rulesets.versions.<a href="./src/resources/rulesets/versions/versions.ts">delete</a>(rulesetId, rulesetVersion, { ...params }) -> void</code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/versions/{ruleset_version}">client.rulesets.versions.<a href="./src/resources/rulesets/versions/versions.ts">get</a>(rulesetId, rulesetVersion, { ...params }) -> VersionGetResponse</code>

### ByTag
- <code title="get /{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/versions">client.rulesets.versions.<a href="./src/resources/rulesets/versions.ts">list</a>(rulesetId, { ...params }) -> VersionListResponsesSinglePage</code>
- <code title="delete /{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/versions/{ruleset_version}">client.rulesets.versions.<a href="./src/resources/rulesets/versions.ts">delete</a>(rulesetId, rulesetVersion, { ...params }) -> void</code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/versions/{ruleset_version}">client.rulesets.versions.<a href="./src/resources/rulesets/versions.ts">get</a>(rulesetId, rulesetVersion, { ...params }) -> VersionGetResponse</code>

# URLNormalization

Expand Down Expand Up @@ -3311,59 +3309,46 @@ Methods:

Types:

- <code><a href="./src/resources/magic-network-monitoring/configs/configs.ts">ConfigCreateResponse</a></code>
- <code><a href="./src/resources/magic-network-monitoring/configs/configs.ts">ConfigUpdateResponse</a></code>
- <code><a href="./src/resources/magic-network-monitoring/configs/configs.ts">ConfigDeleteResponse</a></code>
- <code><a href="./src/resources/magic-network-monitoring/configs/configs.ts">ConfigEditResponse</a></code>
- <code><a href="./src/resources/magic-network-monitoring/configs/configs.ts">ConfigGetResponse</a></code>
- <code><a href="./src/resources/magic-network-monitoring/configs/configs.ts">Configuration</a></code>

Methods:

- <code title="post /accounts/{account_id}/mnm/config">client.magicNetworkMonitoring.configs.<a href="./src/resources/magic-network-monitoring/configs/configs.ts">create</a>({ ...params }) -> ConfigCreateResponse</code>
- <code title="put /accounts/{account_id}/mnm/config">client.magicNetworkMonitoring.configs.<a href="./src/resources/magic-network-monitoring/configs/configs.ts">update</a>({ ...params }) -> ConfigUpdateResponse</code>
- <code title="delete /accounts/{account_id}/mnm/config">client.magicNetworkMonitoring.configs.<a href="./src/resources/magic-network-monitoring/configs/configs.ts">delete</a>({ ...params }) -> ConfigDeleteResponse</code>
- <code title="patch /accounts/{account_id}/mnm/config">client.magicNetworkMonitoring.configs.<a href="./src/resources/magic-network-monitoring/configs/configs.ts">edit</a>({ ...params }) -> ConfigEditResponse</code>
- <code title="get /accounts/{account_id}/mnm/config">client.magicNetworkMonitoring.configs.<a href="./src/resources/magic-network-monitoring/configs/configs.ts">get</a>({ ...params }) -> ConfigGetResponse</code>
- <code title="post /accounts/{account_id}/mnm/config">client.magicNetworkMonitoring.configs.<a href="./src/resources/magic-network-monitoring/configs/configs.ts">create</a>({ ...params }) -> Configuration</code>
- <code title="put /accounts/{account_id}/mnm/config">client.magicNetworkMonitoring.configs.<a href="./src/resources/magic-network-monitoring/configs/configs.ts">update</a>({ ...params }) -> Configuration</code>
- <code title="delete /accounts/{account_id}/mnm/config">client.magicNetworkMonitoring.configs.<a href="./src/resources/magic-network-monitoring/configs/configs.ts">delete</a>({ ...params }) -> Configuration</code>
- <code title="patch /accounts/{account_id}/mnm/config">client.magicNetworkMonitoring.configs.<a href="./src/resources/magic-network-monitoring/configs/configs.ts">edit</a>({ ...params }) -> Configuration</code>
- <code title="get /accounts/{account_id}/mnm/config">client.magicNetworkMonitoring.configs.<a href="./src/resources/magic-network-monitoring/configs/configs.ts">get</a>({ ...params }) -> Configuration</code>

### Full

Types:

- <code><a href="./src/resources/magic-network-monitoring/configs/full.ts">FullGetResponse</a></code>

Methods:

- <code title="get /accounts/{account_id}/mnm/config/full">client.magicNetworkMonitoring.configs.full.<a href="./src/resources/magic-network-monitoring/configs/full.ts">get</a>({ ...params }) -> FullGetResponse</code>
- <code title="get /accounts/{account_id}/mnm/config/full">client.magicNetworkMonitoring.configs.full.<a href="./src/resources/magic-network-monitoring/configs/full.ts">get</a>({ ...params }) -> Configuration</code>

## Rules

Types:

- <code><a href="./src/resources/magic-network-monitoring/rules/rules.ts">RuleCreateResponse</a></code>
- <code><a href="./src/resources/magic-network-monitoring/rules/rules.ts">RuleUpdateResponse</a></code>
- <code><a href="./src/resources/magic-network-monitoring/rules/rules.ts">RuleListResponse</a></code>
- <code><a href="./src/resources/magic-network-monitoring/rules/rules.ts">RuleDeleteResponse</a></code>
- <code><a href="./src/resources/magic-network-monitoring/rules/rules.ts">RuleEditResponse</a></code>
- <code><a href="./src/resources/magic-network-monitoring/rules/rules.ts">RuleGetResponse</a></code>
- <code><a href="./src/resources/magic-network-monitoring/rules/rules.ts">MagicNetworkMonitoringRule</a></code>

Methods:

- <code title="post /accounts/{account_id}/mnm/rules">client.magicNetworkMonitoring.rules.<a href="./src/resources/magic-network-monitoring/rules/rules.ts">create</a>({ ...params }) -> RuleCreateResponse | null</code>
- <code title="put /accounts/{account_id}/mnm/rules">client.magicNetworkMonitoring.rules.<a href="./src/resources/magic-network-monitoring/rules/rules.ts">update</a>({ ...params }) -> RuleUpdateResponse | null</code>
- <code title="get /accounts/{account_id}/mnm/rules">client.magicNetworkMonitoring.rules.<a href="./src/resources/magic-network-monitoring/rules/rules.ts">list</a>({ ...params }) -> RuleListResponsesSinglePage</code>
- <code title="delete /accounts/{account_id}/mnm/rules/{rule_id}">client.magicNetworkMonitoring.rules.<a href="./src/resources/magic-network-monitoring/rules/rules.ts">delete</a>(ruleId, { ...params }) -> RuleDeleteResponse | null</code>
- <code title="patch /accounts/{account_id}/mnm/rules/{rule_id}">client.magicNetworkMonitoring.rules.<a href="./src/resources/magic-network-monitoring/rules/rules.ts">edit</a>(ruleId, { ...params }) -> RuleEditResponse | null</code>
- <code title="get /accounts/{account_id}/mnm/rules/{rule_id}">client.magicNetworkMonitoring.rules.<a href="./src/resources/magic-network-monitoring/rules/rules.ts">get</a>(ruleId, { ...params }) -> RuleGetResponse | null</code>
- <code title="post /accounts/{account_id}/mnm/rules">client.magicNetworkMonitoring.rules.<a href="./src/resources/magic-network-monitoring/rules/rules.ts">create</a>({ ...params }) -> MagicNetworkMonitoringRule | null</code>
- <code title="put /accounts/{account_id}/mnm/rules">client.magicNetworkMonitoring.rules.<a href="./src/resources/magic-network-monitoring/rules/rules.ts">update</a>({ ...params }) -> MagicNetworkMonitoringRule | null</code>
- <code title="get /accounts/{account_id}/mnm/rules">client.magicNetworkMonitoring.rules.<a href="./src/resources/magic-network-monitoring/rules/rules.ts">list</a>({ ...params }) -> MagicNetworkMonitoringRulesSinglePage</code>
- <code title="delete /accounts/{account_id}/mnm/rules/{rule_id}">client.magicNetworkMonitoring.rules.<a href="./src/resources/magic-network-monitoring/rules/rules.ts">delete</a>(ruleId, { ...params }) -> MagicNetworkMonitoringRule | null</code>
- <code title="patch /accounts/{account_id}/mnm/rules/{rule_id}">client.magicNetworkMonitoring.rules.<a href="./src/resources/magic-network-monitoring/rules/rules.ts">edit</a>(ruleId, { ...params }) -> MagicNetworkMonitoringRule | null</code>
- <code title="get /accounts/{account_id}/mnm/rules/{rule_id}">client.magicNetworkMonitoring.rules.<a href="./src/resources/magic-network-monitoring/rules/rules.ts">get</a>(ruleId, { ...params }) -> MagicNetworkMonitoringRule | null</code>

### Advertisements

Types:

- <code><a href="./src/resources/magic-network-monitoring/rules/advertisements.ts">AdvertisementEditResponse</a></code>
- <code><a href="./src/resources/magic-network-monitoring/rules/advertisements.ts">Advertisement</a></code>

Methods:

- <code title="patch /accounts/{account_id}/mnm/rules/{rule_id}/advertisement">client.magicNetworkMonitoring.rules.advertisements.<a href="./src/resources/magic-network-monitoring/rules/advertisements.ts">edit</a>(ruleId, { ...params }) -> AdvertisementEditResponse | null</code>
- <code title="patch /accounts/{account_id}/mnm/rules/{rule_id}/advertisement">client.magicNetworkMonitoring.rules.advertisements.<a href="./src/resources/magic-network-monitoring/rules/advertisements.ts">edit</a>(ruleId, { ...params }) -> Advertisement | null</code>

# MTLSCertificates

Expand Down
196 changes: 16 additions & 180 deletions src/resources/magic-network-monitoring/configs/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
import { APIResource } from '../../../resource';
import * as Core from '../../../core';
import * as FullAPI from './full';
import { Full, FullGetParams, FullGetResponse } from './full';
import { Full, FullGetParams } from './full';

export class Configs extends APIResource {
full: FullAPI.Full = new FullAPI.Full(this._client);

/**
* Create a new network monitoring configuration.
*/
create(params: ConfigCreateParams, options?: Core.RequestOptions): Core.APIPromise<ConfigCreateResponse> {
create(params: ConfigCreateParams, options?: Core.RequestOptions): Core.APIPromise<Configuration> {
const { account_id, ...body } = params;
return (
this._client.post(`/accounts/${account_id}/mnm/config`, { body, ...options }) as Core.APIPromise<{
result: ConfigCreateResponse;
result: Configuration;
}>
)._thenUnwrap((obj) => obj.result);
}
Expand All @@ -24,53 +24,53 @@ export class Configs extends APIResource {
* Update an existing network monitoring configuration, requires the entire
* configuration to be updated at once.
*/
update(params: ConfigUpdateParams, options?: Core.RequestOptions): Core.APIPromise<ConfigUpdateResponse> {
update(params: ConfigUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Configuration> {
const { account_id, ...body } = params;
return (
this._client.put(`/accounts/${account_id}/mnm/config`, { body, ...options }) as Core.APIPromise<{
result: ConfigUpdateResponse;
result: Configuration;
}>
)._thenUnwrap((obj) => obj.result);
}

/**
* Delete an existing network monitoring configuration.
*/
delete(params: ConfigDeleteParams, options?: Core.RequestOptions): Core.APIPromise<ConfigDeleteResponse> {
delete(params: ConfigDeleteParams, options?: Core.RequestOptions): Core.APIPromise<Configuration> {
const { account_id } = params;
return (
this._client.delete(`/accounts/${account_id}/mnm/config`, options) as Core.APIPromise<{
result: ConfigDeleteResponse;
result: Configuration;
}>
)._thenUnwrap((obj) => obj.result);
}

/**
* Update fields in an existing network monitoring configuration.
*/
edit(params: ConfigEditParams, options?: Core.RequestOptions): Core.APIPromise<ConfigEditResponse> {
edit(params: ConfigEditParams, options?: Core.RequestOptions): Core.APIPromise<Configuration> {
const { account_id, ...body } = params;
return (
this._client.patch(`/accounts/${account_id}/mnm/config`, { body, ...options }) as Core.APIPromise<{
result: ConfigEditResponse;
result: Configuration;
}>
)._thenUnwrap((obj) => obj.result);
}

/**
* Lists default sampling, router IPs and warp devices for account.
*/
get(params: ConfigGetParams, options?: Core.RequestOptions): Core.APIPromise<ConfigGetResponse> {
get(params: ConfigGetParams, options?: Core.RequestOptions): Core.APIPromise<Configuration> {
const { account_id } = params;
return (
this._client.get(`/accounts/${account_id}/mnm/config`, options) as Core.APIPromise<{
result: ConfigGetResponse;
result: Configuration;
}>
)._thenUnwrap((obj) => obj.result);
}
}

export interface ConfigCreateResponse {
export interface Configuration {
/**
* Fallback sampling rate of flow messages being sent in packets per second. This
* should match the packet sampling rate configured on the router.
Expand All @@ -84,170 +84,10 @@ export interface ConfigCreateResponse {

router_ips: Array<string>;

warp_devices: Array<ConfigCreateResponse.WARPDevice>;
warp_devices: Array<Configuration.WARPDevice>;
}

export namespace ConfigCreateResponse {
/**
* Object representing a warp device with an ID and name.
*/
export interface WARPDevice {
/**
* Unique identifier for the warp device.
*/
id: string;

/**
* Name of the warp device.
*/
name: string;

/**
* IPv4 CIDR of the router sourcing flow data associated with this warp device.
* Only /32 addresses are currently supported.
*/
router_ip: string;
}
}

export interface ConfigUpdateResponse {
/**
* Fallback sampling rate of flow messages being sent in packets per second. This
* should match the packet sampling rate configured on the router.
*/
default_sampling: number;

/**
* The account name.
*/
name: string;

router_ips: Array<string>;

warp_devices: Array<ConfigUpdateResponse.WARPDevice>;
}

export namespace ConfigUpdateResponse {
/**
* Object representing a warp device with an ID and name.
*/
export interface WARPDevice {
/**
* Unique identifier for the warp device.
*/
id: string;

/**
* Name of the warp device.
*/
name: string;

/**
* IPv4 CIDR of the router sourcing flow data associated with this warp device.
* Only /32 addresses are currently supported.
*/
router_ip: string;
}
}

export interface ConfigDeleteResponse {
/**
* Fallback sampling rate of flow messages being sent in packets per second. This
* should match the packet sampling rate configured on the router.
*/
default_sampling: number;

/**
* The account name.
*/
name: string;

router_ips: Array<string>;

warp_devices: Array<ConfigDeleteResponse.WARPDevice>;
}

export namespace ConfigDeleteResponse {
/**
* Object representing a warp device with an ID and name.
*/
export interface WARPDevice {
/**
* Unique identifier for the warp device.
*/
id: string;

/**
* Name of the warp device.
*/
name: string;

/**
* IPv4 CIDR of the router sourcing flow data associated with this warp device.
* Only /32 addresses are currently supported.
*/
router_ip: string;
}
}

export interface ConfigEditResponse {
/**
* Fallback sampling rate of flow messages being sent in packets per second. This
* should match the packet sampling rate configured on the router.
*/
default_sampling: number;

/**
* The account name.
*/
name: string;

router_ips: Array<string>;

warp_devices: Array<ConfigEditResponse.WARPDevice>;
}

export namespace ConfigEditResponse {
/**
* Object representing a warp device with an ID and name.
*/
export interface WARPDevice {
/**
* Unique identifier for the warp device.
*/
id: string;

/**
* Name of the warp device.
*/
name: string;

/**
* IPv4 CIDR of the router sourcing flow data associated with this warp device.
* Only /32 addresses are currently supported.
*/
router_ip: string;
}
}

export interface ConfigGetResponse {
/**
* Fallback sampling rate of flow messages being sent in packets per second. This
* should match the packet sampling rate configured on the router.
*/
default_sampling: number;

/**
* The account name.
*/
name: string;

router_ips: Array<string>;

warp_devices: Array<ConfigGetResponse.WARPDevice>;
}

export namespace ConfigGetResponse {
export namespace Configuration {
/**
* Object representing a warp device with an ID and name.
*/
Expand Down Expand Up @@ -435,17 +275,13 @@ Configs.Full = Full;

export declare namespace Configs {
export {
type ConfigCreateResponse as ConfigCreateResponse,
type ConfigUpdateResponse as ConfigUpdateResponse,
type ConfigDeleteResponse as ConfigDeleteResponse,
type ConfigEditResponse as ConfigEditResponse,
type ConfigGetResponse as ConfigGetResponse,
type Configuration as Configuration,
type ConfigCreateParams as ConfigCreateParams,
type ConfigUpdateParams as ConfigUpdateParams,
type ConfigDeleteParams as ConfigDeleteParams,
type ConfigEditParams as ConfigEditParams,
type ConfigGetParams as ConfigGetParams,
};

export { Full as Full, type FullGetResponse as FullGetResponse, type FullGetParams as FullGetParams };
export { Full as Full, type FullGetParams as FullGetParams };
}
Loading