Skip to content

Commit

Permalink
feat(client-privatenetworks): This release introduces a new StartNetw…
Browse files Browse the repository at this point in the history
…orkResourceUpdate API, which enables return/replacement of hardware from a NetworkSite.
  • Loading branch information
awstools committed Feb 15, 2023
1 parent 1e9083d commit 804b9bc
Show file tree
Hide file tree
Showing 12 changed files with 924 additions and 291 deletions.
51 changes: 46 additions & 5 deletions clients/client-privatenetworks/src/PrivateNetworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ import {
ListTagsForResourceCommandOutput,
} from "./commands/ListTagsForResourceCommand";
import { PingCommand, PingCommandInput, PingCommandOutput } from "./commands/PingCommand";
import {
StartNetworkResourceUpdateCommand,
StartNetworkResourceUpdateCommandInput,
StartNetworkResourceUpdateCommandOutput,
} from "./commands/StartNetworkResourceUpdateCommand";
import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
import {
UntagResourceCommand,
Expand Down Expand Up @@ -214,7 +219,7 @@ export class PrivateNetworks extends PrivateNetworksClient {
/**
* <p>Configures the specified network resource.
* </p>
* <p>
* <p>
* Use this action to specify the geographic
* position of the hardware. You must provide Certified Professional Installer (CPI)
* credentials in the request so that we can obtain spectrum grants. For more information,
Expand Down Expand Up @@ -568,8 +573,7 @@ export class PrivateNetworks extends PrivateNetworksClient {
* <p>Lists device identifiers. Add filters to your request to return a more
* specific list of results. Use filters to match the Amazon Resource Name (ARN) of an order,
* the status of device identifiers, or the ARN of the traffic group.</p>
*
* <p>If you specify multiple filters, filters are joined with an OR, and the request
* <p>If you specify multiple filters, filters are joined with an OR, and the request
* returns results that match all of the specified filters.</p>
*/
public listDeviceIdentifiers(
Expand Down Expand Up @@ -605,7 +609,7 @@ export class PrivateNetworks extends PrivateNetworksClient {
* <p>Lists network resources. Add filters to your request to return a more
* specific list of results. Use filters to match the Amazon Resource Name (ARN) of an order or
* the status of network resources.</p>
* <p>If you specify multiple filters, filters are joined with an OR, and the request
* <p>If you specify multiple filters, filters are joined with an OR, and the request
* returns results that match all of the specified filters.</p>
*/
public listNetworkResources(
Expand Down Expand Up @@ -704,7 +708,7 @@ export class PrivateNetworks extends PrivateNetworksClient {
* <p>Lists orders. Add filters to your request to return a more
* specific list of results. Use filters to match the Amazon Resource Name (ARN) of the network site or
* the status of the order.</p>
* <p>If you specify multiple filters, filters are joined with an OR, and the request
* <p>If you specify multiple filters, filters are joined with an OR, and the request
* returns results that match all of the specified filters.</p>
*/
public listOrders(args: ListOrdersCommandInput, options?: __HttpHandlerOptions): Promise<ListOrdersCommandOutput>;
Expand Down Expand Up @@ -788,6 +792,43 @@ export class PrivateNetworks extends PrivateNetworksClient {
}
}

/**
* <p>Starts an update of the specified network resource.</p>
* <p>After you submit a request to replace or return a network resource, the status
* of the network resource is <code>CREATING_SHIPPING_LABEL</code>. The shipping label
* is available when the status of the network resource is <code>PENDING_RETURN</code>.
* After the network resource is successfully returned, its status is <code>DELETED</code>.
* For more information, see <a href="https://docs.aws.amazon.com/private-networks/latest/userguide/radio-units.html#return-radio-unit">Return a radio unit</a>.</p>
*/
public startNetworkResourceUpdate(
args: StartNetworkResourceUpdateCommandInput,
options?: __HttpHandlerOptions
): Promise<StartNetworkResourceUpdateCommandOutput>;
public startNetworkResourceUpdate(
args: StartNetworkResourceUpdateCommandInput,
cb: (err: any, data?: StartNetworkResourceUpdateCommandOutput) => void
): void;
public startNetworkResourceUpdate(
args: StartNetworkResourceUpdateCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: StartNetworkResourceUpdateCommandOutput) => void
): void;
public startNetworkResourceUpdate(
args: StartNetworkResourceUpdateCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: StartNetworkResourceUpdateCommandOutput) => void),
cb?: (err: any, data?: StartNetworkResourceUpdateCommandOutput) => void
): Promise<StartNetworkResourceUpdateCommandOutput> | void {
const command = new StartNetworkResourceUpdateCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>
* Adds tags to the specified resource.
Expand Down
6 changes: 6 additions & 0 deletions clients/client-privatenetworks/src/PrivateNetworksClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ import {
ListTagsForResourceCommandOutput,
} from "./commands/ListTagsForResourceCommand";
import { PingCommandInput, PingCommandOutput } from "./commands/PingCommand";
import {
StartNetworkResourceUpdateCommandInput,
StartNetworkResourceUpdateCommandOutput,
} from "./commands/StartNetworkResourceUpdateCommand";
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
import { UpdateNetworkSiteCommandInput, UpdateNetworkSiteCommandOutput } from "./commands/UpdateNetworkSiteCommand";
Expand Down Expand Up @@ -134,6 +138,7 @@ export type ServiceInputTypes =
| ListOrdersCommandInput
| ListTagsForResourceCommandInput
| PingCommandInput
| StartNetworkResourceUpdateCommandInput
| TagResourceCommandInput
| UntagResourceCommandInput
| UpdateNetworkSiteCommandInput
Expand Down Expand Up @@ -161,6 +166,7 @@ export type ServiceOutputTypes =
| ListOrdersCommandOutput
| ListTagsForResourceCommandOutput
| PingCommandOutput
| StartNetworkResourceUpdateCommandOutput
| TagResourceCommandOutput
| UntagResourceCommandOutput
| UpdateNetworkSiteCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface ConfigureAccessPointCommandOutput extends ConfigureAccessPointR
/**
* <p>Configures the specified network resource.
* </p>
* <p>
* <p>
* Use this action to specify the geographic
* position of the hardware. You must provide Certified Professional Installer (CPI)
* credentials in the request so that we can obtain spectrum grants. For more information,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ export interface ListDeviceIdentifiersCommandOutput extends ListDeviceIdentifier
* <p>Lists device identifiers. Add filters to your request to return a more
* specific list of results. Use filters to match the Amazon Resource Name (ARN) of an order,
* the status of device identifiers, or the ARN of the traffic group.</p>
*
* <p>If you specify multiple filters, filters are joined with an OR, and the request
* <p>If you specify multiple filters, filters are joined with an OR, and the request
* returns results that match all of the specified filters.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface ListNetworkResourcesCommandOutput extends ListNetworkResourcesR
* <p>Lists network resources. Add filters to your request to return a more
* specific list of results. Use filters to match the Amazon Resource Name (ARN) of an order or
* the status of network resources.</p>
* <p>If you specify multiple filters, filters are joined with an OR, and the request
* <p>If you specify multiple filters, filters are joined with an OR, and the request
* returns results that match all of the specified filters.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface ListOrdersCommandOutput extends ListOrdersResponse, __MetadataB
* <p>Lists orders. Add filters to your request to return a more
* specific list of results. Use filters to match the Amazon Resource Name (ARN) of the network site or
* the status of the order.</p>
* <p>If you specify multiple filters, filters are joined with an OR, and the request
* <p>If you specify multiple filters, filters are joined with an OR, and the request
* returns results that match all of the specified filters.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
import { Command as $Command } from "@aws-sdk/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";

import {
StartNetworkResourceUpdateRequest,
StartNetworkResourceUpdateRequestFilterSensitiveLog,
StartNetworkResourceUpdateResponse,
StartNetworkResourceUpdateResponseFilterSensitiveLog,
} from "../models/models_0";
import { PrivateNetworksClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../PrivateNetworksClient";
import {
deserializeAws_restJson1StartNetworkResourceUpdateCommand,
serializeAws_restJson1StartNetworkResourceUpdateCommand,
} from "../protocols/Aws_restJson1";

export interface StartNetworkResourceUpdateCommandInput extends StartNetworkResourceUpdateRequest {}
export interface StartNetworkResourceUpdateCommandOutput extends StartNetworkResourceUpdateResponse, __MetadataBearer {}

/**
* <p>Starts an update of the specified network resource.</p>
* <p>After you submit a request to replace or return a network resource, the status
* of the network resource is <code>CREATING_SHIPPING_LABEL</code>. The shipping label
* is available when the status of the network resource is <code>PENDING_RETURN</code>.
* After the network resource is successfully returned, its status is <code>DELETED</code>.
* For more information, see <a href="https://docs.aws.amazon.com/private-networks/latest/userguide/radio-units.html#return-radio-unit">Return a radio unit</a>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { PrivateNetworksClient, StartNetworkResourceUpdateCommand } from "@aws-sdk/client-privatenetworks"; // ES Modules import
* // const { PrivateNetworksClient, StartNetworkResourceUpdateCommand } = require("@aws-sdk/client-privatenetworks"); // CommonJS import
* const client = new PrivateNetworksClient(config);
* const command = new StartNetworkResourceUpdateCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link StartNetworkResourceUpdateCommandInput} for command's `input` shape.
* @see {@link StartNetworkResourceUpdateCommandOutput} for command's `response` shape.
* @see {@link PrivateNetworksClientResolvedConfig | config} for PrivateNetworksClient's `config` shape.
*
*/
export class StartNetworkResourceUpdateCommand extends $Command<
StartNetworkResourceUpdateCommandInput,
StartNetworkResourceUpdateCommandOutput,
PrivateNetworksClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

constructor(readonly input: StartNetworkResourceUpdateCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: PrivateNetworksClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<StartNetworkResourceUpdateCommandInput, StartNetworkResourceUpdateCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, StartNetworkResourceUpdateCommand.getEndpointParameterInstructions())
);

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "PrivateNetworksClient";
const commandName = "StartNetworkResourceUpdateCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: StartNetworkResourceUpdateRequestFilterSensitiveLog,
outputFilterSensitiveLog: StartNetworkResourceUpdateResponseFilterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

private serialize(input: StartNetworkResourceUpdateCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_restJson1StartNetworkResourceUpdateCommand(input, context);
}

private deserialize(
output: __HttpResponse,
context: __SerdeContext
): Promise<StartNetworkResourceUpdateCommandOutput> {
return deserializeAws_restJson1StartNetworkResourceUpdateCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
1 change: 1 addition & 0 deletions clients/client-privatenetworks/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export * from "./ListNetworksCommand";
export * from "./ListOrdersCommand";
export * from "./ListTagsForResourceCommand";
export * from "./PingCommand";
export * from "./StartNetworkResourceUpdateCommand";
export * from "./TagResourceCommand";
export * from "./UntagResourceCommand";
export * from "./UpdateNetworkSiteCommand";
Expand Down
35 changes: 18 additions & 17 deletions clients/client-privatenetworks/src/endpoint/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,25 @@ import { RuleSetObject } from "@aws-sdk/util-endpoints";
or see "smithy.rules#endpointRuleSet"
in codegen/sdk-codegen/aws-models/privatenetworks.json */

const p="required",
q="fn",
r="argv",
s="ref";
const a="PartitionResult",
const q="required",
r="fn",
s="argv",
t="ref";
const a="isSet",
b="tree",
c="error",
d="endpoint",
e={[p]:false,"type":"String"},
f={[p]:true,"default":false,"type":"Boolean"},
g={[s]:"Endpoint"},
h={[q]:"booleanEquals",[r]:[{[s]:"UseFIPS"},true]},
i={[q]:"booleanEquals",[r]:[{[s]:"UseDualStack"},true]},
j={},
k={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:a},"supportsFIPS"]}]},
l={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:a},"supportsDualStack"]}]},
m=[g],
n=[h],
o=[i];
const _data={version:"1.0",parameters:{Region:e,UseDualStack:f,UseFIPS:f,Endpoint:e},rules:[{conditions:[{[q]:"aws.partition",[r]:[{[s]:"Region"}],assign:a}],type:b,rules:[{conditions:[{[q]:"isSet",[r]:m},{[q]:"parseURL",[r]:m,assign:"url"}],type:b,rules:[{conditions:n,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:o,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:g,properties:j,headers:j},type:d}]}]},{conditions:[h,i],type:b,rules:[{conditions:[k,l],type:b,rules:[{endpoint:{url:"https://private-networks-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:j,headers:j},type:d}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:n,type:b,rules:[{conditions:[k],type:b,rules:[{endpoint:{url:"https://private-networks-fips.{Region}.{PartitionResult#dnsSuffix}",properties:j,headers:j},type:d}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:o,type:b,rules:[{conditions:[l],type:b,rules:[{endpoint:{url:"https://private-networks.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:j,headers:j},type:d}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{endpoint:{url:"https://private-networks.{Region}.{PartitionResult#dnsSuffix}",properties:j,headers:j},type:d}]}]};
e="PartitionResult",
f={[q]:false,"type":"String"},
g={[q]:true,"default":false,"type":"Boolean"},
h={[t]:"Endpoint"},
i={[r]:"booleanEquals",[s]:[{[t]:"UseFIPS"},true]},
j={[r]:"booleanEquals",[s]:[{[t]:"UseDualStack"},true]},
k={},
l={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:e},"supportsFIPS"]}]},
m={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:e},"supportsDualStack"]}]},
n=[i],
o=[j],
p=[{[t]:"Region"}];
const _data={version:"1.0",parameters:{Region:f,UseDualStack:g,UseFIPS:g,Endpoint:f},rules:[{conditions:[{[r]:a,[s]:[h]}],type:b,rules:[{conditions:n,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:o,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:h,properties:k,headers:k},type:d}]}]},{type:b,rules:[{conditions:[{[r]:a,[s]:p}],type:b,rules:[{conditions:[{[r]:"aws.partition",[s]:p,assign:e}],type:b,rules:[{conditions:[i,j],type:b,rules:[{conditions:[l,m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://private-networks-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:n,type:b,rules:[{conditions:[l],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://private-networks-fips.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:o,type:b,rules:[{conditions:[m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://private-networks.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{type:b,rules:[{endpoint:{url:"https://private-networks.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]}]},{error:"Invalid Configuration: Missing Region",type:c}]}]};
export const ruleSet: RuleSetObject = _data;
Loading

0 comments on commit 804b9bc

Please sign in to comment.