Skip to content

Commit

Permalink
feat(client-sagemaker): Cross account support for SageMaker Feature S…
Browse files Browse the repository at this point in the history
…tore
  • Loading branch information
awstools committed Jul 20, 2023
1 parent 72eb598 commit e4918c1
Show file tree
Hide file tree
Showing 20 changed files with 1,441 additions and 695 deletions.
8 changes: 8 additions & 0 deletions clients/client-sagemaker/README.md
Expand Up @@ -2049,6 +2049,14 @@ ListProjects

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sagemaker/classes/listprojectscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sagemaker/interfaces/listprojectscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sagemaker/interfaces/listprojectscommandoutput.html)

</details>
<details>
<summary>
ListResourceCatalogs
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sagemaker/classes/listresourcecatalogscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sagemaker/interfaces/listresourcecatalogscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sagemaker/interfaces/listresourcecatalogscommandoutput.html)

</details>
<details>
<summary>
Expand Down
23 changes: 23 additions & 0 deletions clients/client-sagemaker/src/SageMaker.ts
Expand Up @@ -1051,6 +1051,11 @@ import {
ListProjectsCommandInput,
ListProjectsCommandOutput,
} from "./commands/ListProjectsCommand";
import {
ListResourceCatalogsCommand,
ListResourceCatalogsCommandInput,
ListResourceCatalogsCommandOutput,
} from "./commands/ListResourceCatalogsCommand";
import { ListSpacesCommand, ListSpacesCommandInput, ListSpacesCommandOutput } from "./commands/ListSpacesCommand";
import {
ListStageDevicesCommand,
Expand Down Expand Up @@ -1616,6 +1621,7 @@ const commands = {
ListPipelinesCommand,
ListProcessingJobsCommand,
ListProjectsCommand,
ListResourceCatalogsCommand,
ListSpacesCommand,
ListStageDevicesCommand,
ListStudioLifecycleConfigsCommand,
Expand Down Expand Up @@ -5261,6 +5267,23 @@ export interface SageMaker {
cb: (err: any, data?: ListProjectsCommandOutput) => void
): void;

/**
* @see {@link ListResourceCatalogsCommand}
*/
listResourceCatalogs(
args: ListResourceCatalogsCommandInput,
options?: __HttpHandlerOptions
): Promise<ListResourceCatalogsCommandOutput>;
listResourceCatalogs(
args: ListResourceCatalogsCommandInput,
cb: (err: any, data?: ListResourceCatalogsCommandOutput) => void
): void;
listResourceCatalogs(
args: ListResourceCatalogsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListResourceCatalogsCommandOutput) => void
): void;

/**
* @see {@link ListSpacesCommand}
*/
Expand Down
6 changes: 6 additions & 0 deletions clients/client-sagemaker/src/SageMakerClient.ts
Expand Up @@ -638,6 +638,10 @@ import {
import { ListPipelinesCommandInput, ListPipelinesCommandOutput } from "./commands/ListPipelinesCommand";
import { ListProcessingJobsCommandInput, ListProcessingJobsCommandOutput } from "./commands/ListProcessingJobsCommand";
import { ListProjectsCommandInput, ListProjectsCommandOutput } from "./commands/ListProjectsCommand";
import {
ListResourceCatalogsCommandInput,
ListResourceCatalogsCommandOutput,
} from "./commands/ListResourceCatalogsCommand";
import { ListSpacesCommandInput, ListSpacesCommandOutput } from "./commands/ListSpacesCommand";
import { ListStageDevicesCommandInput, ListStageDevicesCommandOutput } from "./commands/ListStageDevicesCommand";
import {
Expand Down Expand Up @@ -1050,6 +1054,7 @@ export type ServiceInputTypes =
| ListPipelinesCommandInput
| ListProcessingJobsCommandInput
| ListProjectsCommandInput
| ListResourceCatalogsCommandInput
| ListSpacesCommandInput
| ListStageDevicesCommandInput
| ListStudioLifecycleConfigsCommandInput
Expand Down Expand Up @@ -1357,6 +1362,7 @@ export type ServiceOutputTypes =
| ListPipelinesCommandOutput
| ListProcessingJobsCommandOutput
| ListProjectsCommandOutput
| ListResourceCatalogsCommandOutput
| ListSpacesCommandOutput
| ListStageDevicesCommandOutput
| ListStudioLifecycleConfigsCommandOutput
Expand Down
Expand Up @@ -43,8 +43,9 @@ export interface CreateFeatureGroupCommandOutput extends CreateFeatureGroupRespo
* FeatureGroup. A <code>FeatureGroup</code> definition is composed of a list of
* <code>Features</code>, a <code>RecordIdentifierFeatureName</code>, an
* <code>EventTimeFeatureName</code> and configurations for its <code>OnlineStore</code>
* and <code>OfflineStore</code>. Check <a href="https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html">Amazon Web Services service quotas</a> to see
* the <code>FeatureGroup</code>s quota for your Amazon Web Services account.</p>
* and <code>OfflineStore</code>. Check <a href="https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html">Amazon Web Services service
* quotas</a> to see the <code>FeatureGroup</code>s quota for your Amazon Web Services
* account.</p>
* <important>
* <p>You must include at least one of <code>OnlineStoreConfig</code> and
* <code>OfflineStoreConfig</code> to create a <code>FeatureGroup</code>.</p>
Expand Down
Expand Up @@ -39,9 +39,8 @@ export interface DeleteFeatureGroupCommandOutput extends __MetadataBearer {}
* <p>Delete the <code>FeatureGroup</code> and any data that was written to the
* <code>OnlineStore</code> of the <code>FeatureGroup</code>. Data cannot be accessed from
* the <code>OnlineStore</code> immediately after <code>DeleteFeatureGroup</code> is called. </p>
* <p>Data written into the <code>OfflineStore</code> will not be deleted. The Amazon Web Services Glue
* database and tables that are automatically created for your <code>OfflineStore</code> are
* not deleted. </p>
* <p>Data written into the <code>OfflineStore</code> will not be deleted. The Amazon Web Services Glue database and tables that are automatically created for your
* <code>OfflineStore</code> are not deleted. </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Expand Up @@ -13,7 +13,7 @@ import {
SerdeContext as __SerdeContext,
} from "@smithy/types";

import { DeleteHubContentRequest } from "../models/models_1";
import { DeleteHubContentRequest } from "../models/models_2";
import { de_DeleteHubContentCommand, se_DeleteHubContentCommand } from "../protocols/Aws_json1_1";
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";

Expand Down
Expand Up @@ -13,10 +13,8 @@ import {
SerdeContext as __SerdeContext,
} from "@smithy/types";

import {
GetSagemakerServicecatalogPortfolioStatusInput,
GetSagemakerServicecatalogPortfolioStatusOutput,
} from "../models/models_2";
import { GetSagemakerServicecatalogPortfolioStatusInput } from "../models/models_2";
import { GetSagemakerServicecatalogPortfolioStatusOutput } from "../models/models_3";
import {
de_GetSagemakerServicecatalogPortfolioStatusCommand,
se_GetSagemakerServicecatalogPortfolioStatusCommand,
Expand Down
157 changes: 157 additions & 0 deletions clients/client-sagemaker/src/commands/ListResourceCatalogsCommand.ts
@@ -0,0 +1,157 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { Command as $Command } from "@smithy/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
} from "@smithy/types";

import { ListResourceCatalogsRequest, ListResourceCatalogsResponse } from "../models/models_3";
import { de_ListResourceCatalogsCommand, se_ListResourceCatalogsCommand } from "../protocols/Aws_json1_1";
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";

/**
* @public
*/
export { __MetadataBearer, $Command };
/**
* @public
*
* The input for {@link ListResourceCatalogsCommand}.
*/
export interface ListResourceCatalogsCommandInput extends ListResourceCatalogsRequest {}
/**
* @public
*
* The output of {@link ListResourceCatalogsCommand}.
*/
export interface ListResourceCatalogsCommandOutput extends ListResourceCatalogsResponse, __MetadataBearer {}

/**
* @public
* <p> Lists Amazon SageMaker Catalogs based on given filters and orders. The maximum number of
* <code>ResourceCatalog</code>s viewable is 1000. </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { SageMakerClient, ListResourceCatalogsCommand } from "@aws-sdk/client-sagemaker"; // ES Modules import
* // const { SageMakerClient, ListResourceCatalogsCommand } = require("@aws-sdk/client-sagemaker"); // CommonJS import
* const client = new SageMakerClient(config);
* const input = { // ListResourceCatalogsRequest
* NameContains: "STRING_VALUE",
* CreationTimeAfter: new Date("TIMESTAMP"),
* CreationTimeBefore: new Date("TIMESTAMP"),
* SortOrder: "Ascending" || "Descending",
* SortBy: "CreationTime",
* MaxResults: Number("int"),
* NextToken: "STRING_VALUE",
* };
* const command = new ListResourceCatalogsCommand(input);
* const response = await client.send(command);
* // { // ListResourceCatalogsResponse
* // ResourceCatalogs: [ // ResourceCatalogList
* // { // ResourceCatalog
* // ResourceCatalogArn: "STRING_VALUE", // required
* // ResourceCatalogName: "STRING_VALUE", // required
* // Description: "STRING_VALUE", // required
* // CreationTime: new Date("TIMESTAMP"), // required
* // },
* // ],
* // NextToken: "STRING_VALUE",
* // };
*
* ```
*
* @param ListResourceCatalogsCommandInput - {@link ListResourceCatalogsCommandInput}
* @returns {@link ListResourceCatalogsCommandOutput}
* @see {@link ListResourceCatalogsCommandInput} for command's `input` shape.
* @see {@link ListResourceCatalogsCommandOutput} for command's `response` shape.
* @see {@link SageMakerClientResolvedConfig | config} for SageMakerClient's `config` shape.
*
* @throws {@link SageMakerServiceException}
* <p>Base exception class for all service exceptions from SageMaker service.</p>
*
*/
export class ListResourceCatalogsCommand extends $Command<
ListResourceCatalogsCommandInput,
ListResourceCatalogsCommandOutput,
SageMakerClientResolvedConfig
> {
// 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" },
};
}

/**
* @public
*/
constructor(readonly input: ListResourceCatalogsCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: SageMakerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ListResourceCatalogsCommandInput, ListResourceCatalogsCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, ListResourceCatalogsCommand.getEndpointParameterInstructions())
);

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

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

/**
* @internal
*/
private serialize(input: ListResourceCatalogsCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return se_ListResourceCatalogsCommand(input, context);
}

/**
* @internal
*/
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<ListResourceCatalogsCommandOutput> {
return de_ListResourceCatalogsCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
Expand Up @@ -13,7 +13,7 @@ import {
SerdeContext as __SerdeContext,
} from "@smithy/types";

import { RetryPipelineExecutionRequest, RetryPipelineExecutionResponse } from "../models/models_3";
import { RetryPipelineExecutionRequest, RetryPipelineExecutionResponse } from "../models/models_4";
import { de_RetryPipelineExecutionCommand, se_RetryPipelineExecutionCommand } from "../protocols/Aws_json1_1";
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";

Expand Down
1 change: 1 addition & 0 deletions clients/client-sagemaker/src/commands/SearchCommand.ts
Expand Up @@ -101,6 +101,7 @@ export interface SearchCommandOutput extends SearchResponse, __MetadataBearer {}
* SortOrder: "Ascending" || "Descending",
* NextToken: "STRING_VALUE",
* MaxResults: Number("int"),
* CrossAccountFilterOption: "SameAccount" || "CrossAccount",
* };
* const command = new SearchCommand(input);
* const response = await client.send(command);
Expand Down
Expand Up @@ -36,7 +36,18 @@ export interface UpdateFeatureGroupCommandOutput extends UpdateFeatureGroupRespo

/**
* @public
* <p>Updates the feature group.</p>
* <p>Updates the feature group by either adding features or updating the online store
* configuration. Use one of the following request parameters at a time while using the
* <code>UpdateFeatureGroup</code> API.</p>
* <p>You can add features for your feature group using the <code>FeatureAdditions</code>
* request parameter. Features cannot be removed from a feature group.</p>
* <p>You can update the online store configuration by using the
* <code>OnlineStoreConfig</code> request parameter. If a <code>TtlDuration</code> is
* specified, the default <code>TtlDuration</code> applies for all records added to the
* feature group <i>after the feature group is updated</i>. If a record level
* <code>TtlDuration</code> exists from using the <code>PutRecord</code> API, the record
* level <code>TtlDuration</code> applies to that record instead of the default
* <code>TtlDuration</code>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
1 change: 1 addition & 0 deletions clients/client-sagemaker/src/commands/index.ts
Expand Up @@ -228,6 +228,7 @@ export * from "./ListPipelineParametersForExecutionCommand";
export * from "./ListPipelinesCommand";
export * from "./ListProcessingJobsCommand";
export * from "./ListProjectsCommand";
export * from "./ListResourceCatalogsCommand";
export * from "./ListSpacesCommand";
export * from "./ListStageDevicesCommand";
export * from "./ListStudioLifecycleConfigsCommand";
Expand Down

0 comments on commit e4918c1

Please sign in to comment.