repo_name
stringlengths
1
52
repo_creator
stringclasses
6 values
programming_language
stringclasses
4 values
code
stringlengths
0
9.68M
num_lines
int64
1
234k
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( smithydocument "github.com/aws/smithy-go/document" "time" ) // Represents the output of a GetBatchPrediction operation. The content consists // of the detailed metadata, the status, and the data file information of a Batch // Prediction . type BatchPrediction struct { // The ID of the DataSource that points to the group of observations to predict. BatchPredictionDataSourceId *string // The ID assigned to the BatchPrediction at creation. This value should be // identical to the value of the BatchPredictionID in the request. BatchPredictionId *string // Long integer type that is a 64-bit signed number. ComputeTime *int64 // The time that the BatchPrediction was created. The time is expressed in epoch // time. CreatedAt *time.Time // The AWS user account that invoked the BatchPrediction . The account type can be // either an AWS root account or an AWS Identity and Access Management (IAM) user // account. CreatedByIamUser *string // A timestamp represented in epoch time. FinishedAt *time.Time // The location of the data file or directory in Amazon Simple Storage Service // (Amazon S3). InputDataLocationS3 *string // Long integer type that is a 64-bit signed number. InvalidRecordCount *int64 // The time of the most recent edit to the BatchPrediction . The time is expressed // in epoch time. LastUpdatedAt *time.Time // The ID of the MLModel that generated predictions for the BatchPrediction // request. MLModelId *string // A description of the most recent details about processing the batch prediction // request. Message *string // A user-supplied name or description of the BatchPrediction . Name *string // The location of an Amazon S3 bucket or directory to receive the operation // results. The following substrings are not allowed in the s3 key portion of the // outputURI field: ':', '//', '/./', '/../'. OutputUri *string // A timestamp represented in epoch time. StartedAt *time.Time // The status of the BatchPrediction . This element can have one of the following // values: // - PENDING - Amazon Machine Learning (Amazon ML) submitted a request to // generate predictions for a batch of observations. // - INPROGRESS - The process is underway. // - FAILED - The request to perform a batch prediction did not run to // completion. It is not usable. // - COMPLETED - The batch prediction process completed successfully. // - DELETED - The BatchPrediction is marked as deleted. It is not usable. Status EntityStatus // Long integer type that is a 64-bit signed number. TotalRecordCount *int64 noSmithyDocumentSerde } // Represents the output of the GetDataSource operation. The content consists of // the detailed metadata and data file information and the current status of the // DataSource . type DataSource struct { // The parameter is true if statistics need to be generated from the observation // data. ComputeStatistics bool // Long integer type that is a 64-bit signed number. ComputeTime *int64 // The time that the DataSource was created. The time is expressed in epoch time. CreatedAt *time.Time // The AWS user account from which the DataSource was created. The account type // can be either an AWS root account or an AWS Identity and Access Management (IAM) // user account. CreatedByIamUser *string // The location and name of the data in Amazon Simple Storage Service (Amazon S3) // that is used by a DataSource . DataLocationS3 *string // A JSON string that represents the splitting and rearrangement requirement used // when this DataSource was created. DataRearrangement *string // The total number of observations contained in the data files that the DataSource // references. DataSizeInBytes *int64 // The ID that is assigned to the DataSource during creation. DataSourceId *string // A timestamp represented in epoch time. FinishedAt *time.Time // The time of the most recent edit to the BatchPrediction . The time is expressed // in epoch time. LastUpdatedAt *time.Time // A description of the most recent details about creating the DataSource . Message *string // A user-supplied name or description of the DataSource . Name *string // The number of data files referenced by the DataSource . NumberOfFiles *int64 // The datasource details that are specific to Amazon RDS. RDSMetadata *RDSMetadata // Describes the DataSource details specific to Amazon Redshift. RedshiftMetadata *RedshiftMetadata // The Amazon Resource Name (ARN) of an AWS IAM Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.html#roles-about-termsandconcepts) // , such as the following: arn:aws:iam::account:role/rolename. RoleARN *string // A timestamp represented in epoch time. StartedAt *time.Time // The current status of the DataSource . This element can have one of the // following values: // - PENDING - Amazon Machine Learning (Amazon ML) submitted a request to create // a DataSource . // - INPROGRESS - The creation process is underway. // - FAILED - The request to create a DataSource did not run to completion. It is // not usable. // - COMPLETED - The creation process completed successfully. // - DELETED - The DataSource is marked as deleted. It is not usable. Status EntityStatus noSmithyDocumentSerde } // Represents the output of GetEvaluation operation. The content consists of the // detailed metadata and data file information and the current status of the // Evaluation . type Evaluation struct { // Long integer type that is a 64-bit signed number. ComputeTime *int64 // The time that the Evaluation was created. The time is expressed in epoch time. CreatedAt *time.Time // The AWS user account that invoked the evaluation. The account type can be // either an AWS root account or an AWS Identity and Access Management (IAM) user // account. CreatedByIamUser *string // The ID of the DataSource that is used to evaluate the MLModel . EvaluationDataSourceId *string // The ID that is assigned to the Evaluation at creation. EvaluationId *string // A timestamp represented in epoch time. FinishedAt *time.Time // The location and name of the data in Amazon Simple Storage Server (Amazon S3) // that is used in the evaluation. InputDataLocationS3 *string // The time of the most recent edit to the Evaluation . The time is expressed in // epoch time. LastUpdatedAt *time.Time // The ID of the MLModel that is the focus of the evaluation. MLModelId *string // A description of the most recent details about evaluating the MLModel . Message *string // A user-supplied name or description of the Evaluation . Name *string // Measurements of how well the MLModel performed, using observations referenced // by the DataSource . One of the following metrics is returned, based on the type // of the MLModel : // - BinaryAUC: A binary MLModel uses the Area Under the Curve (AUC) technique to // measure performance. // - RegressionRMSE: A regression MLModel uses the Root Mean Square Error (RMSE) // technique to measure performance. RMSE measures the difference between predicted // and actual values for a single variable. // - MulticlassAvgFScore: A multiclass MLModel uses the F1 score technique to // measure performance. // For more information about performance metrics, please see the Amazon Machine // Learning Developer Guide (https://docs.aws.amazon.com/machine-learning/latest/dg) // . PerformanceMetrics *PerformanceMetrics // A timestamp represented in epoch time. StartedAt *time.Time // The status of the evaluation. This element can have one of the following // values: // - PENDING - Amazon Machine Learning (Amazon ML) submitted a request to // evaluate an MLModel . // - INPROGRESS - The evaluation is underway. // - FAILED - The request to evaluate an MLModel did not run to completion. It is // not usable. // - COMPLETED - The evaluation process completed successfully. // - DELETED - The Evaluation is marked as deleted. It is not usable. Status EntityStatus noSmithyDocumentSerde } // Represents the output of a GetMLModel operation. The content consists of the // detailed metadata and the current status of the MLModel . type MLModel struct { // The algorithm used to train the MLModel . The following algorithm is supported: // - SGD -- Stochastic gradient descent. The goal of SGD is to minimize the // gradient of the loss function. Algorithm Algorithm // Long integer type that is a 64-bit signed number. ComputeTime *int64 // The time that the MLModel was created. The time is expressed in epoch time. CreatedAt *time.Time // The AWS user account from which the MLModel was created. The account type can // be either an AWS root account or an AWS Identity and Access Management (IAM) // user account. CreatedByIamUser *string // The current endpoint of the MLModel . EndpointInfo *RealtimeEndpointInfo // A timestamp represented in epoch time. FinishedAt *time.Time // The location of the data file or directory in Amazon Simple Storage Service // (Amazon S3). InputDataLocationS3 *string // The time of the most recent edit to the MLModel . The time is expressed in epoch // time. LastUpdatedAt *time.Time // The ID assigned to the MLModel at creation. MLModelId *string // Identifies the MLModel category. The following are the available types: // - REGRESSION - Produces a numeric result. For example, "What price should a // house be listed at?" // - BINARY - Produces one of two possible results. For example, "Is this a // child-friendly web site?". // - MULTICLASS - Produces one of several possible results. For example, "Is this // a HIGH-, LOW-, or MEDIUM-risk trade?". MLModelType MLModelType // A description of the most recent details about accessing the MLModel . Message *string // A user-supplied name or description of the MLModel . Name *string ScoreThreshold *float32 // The time of the most recent edit to the ScoreThreshold . The time is expressed // in epoch time. ScoreThresholdLastUpdatedAt *time.Time // Long integer type that is a 64-bit signed number. SizeInBytes *int64 // A timestamp represented in epoch time. StartedAt *time.Time // The current status of an MLModel . This element can have one of the following // values: // - PENDING - Amazon Machine Learning (Amazon ML) submitted a request to create // an MLModel . // - INPROGRESS - The creation process is underway. // - FAILED - The request to create an MLModel didn't run to completion. The // model isn't usable. // - COMPLETED - The creation process completed successfully. // - DELETED - The MLModel is marked as deleted. It isn't usable. Status EntityStatus // The ID of the training DataSource . The CreateMLModel operation uses the // TrainingDataSourceId . TrainingDataSourceId *string // A list of the training parameters in the MLModel . The list is implemented as a // map of key-value pairs. The following is the current set of training parameters: // // - sgd.maxMLModelSizeInBytes - The maximum allowed size of the model. Depending // on the input data, the size of the model might affect its performance. The value // is an integer that ranges from 100000 to 2147483648 . The default value is // 33554432 . // - sgd.maxPasses - The number of times that the training process traverses the // observations to build the MLModel . The value is an integer that ranges from 1 // to 10000 . The default value is 10 . // - sgd.shuffleType - Whether Amazon ML shuffles the training data. Shuffling // the data improves a model's ability to find the optimal solution for a variety // of data types. The valid values are auto and none . The default value is none // . // - sgd.l1RegularizationAmount - The coefficient regularization L1 norm, which // controls overfitting the data by penalizing large coefficients. This parameter // tends to drive coefficients to zero, resulting in sparse feature set. If you use // this parameter, start by specifying a small value, such as 1.0E-08 . The value // is a double that ranges from 0 to MAX_DOUBLE . The default is to not use L1 // normalization. This parameter can't be used when L2 is specified. Use this // parameter sparingly. // - sgd.l2RegularizationAmount - The coefficient regularization L2 norm, which // controls overfitting the data by penalizing large coefficients. This tends to // drive coefficients to small, nonzero values. If you use this parameter, start by // specifying a small value, such as 1.0E-08 . The value is a double that ranges // from 0 to MAX_DOUBLE . The default is to not use L2 normalization. This // parameter can't be used when L1 is specified. Use this parameter sparingly. TrainingParameters map[string]string noSmithyDocumentSerde } // Measurements of how well the MLModel performed on known observations. One of // the following metrics is returned, based on the type of the MLModel : // - BinaryAUC: The binary MLModel uses the Area Under the Curve (AUC) technique // to measure performance. // - RegressionRMSE: The regression MLModel uses the Root Mean Square Error // (RMSE) technique to measure performance. RMSE measures the difference between // predicted and actual values for a single variable. // - MulticlassAvgFScore: The multiclass MLModel uses the F1 score technique to // measure performance. // // For more information about performance metrics, please see the Amazon Machine // Learning Developer Guide (https://docs.aws.amazon.com/machine-learning/latest/dg) // . type PerformanceMetrics struct { Properties map[string]string noSmithyDocumentSerde } // The output from a Predict operation: // - Details - Contains the following attributes: // DetailsAttributes.PREDICTIVE_MODEL_TYPE - REGRESSION | BINARY | MULTICLASS // DetailsAttributes.ALGORITHM - SGD // - PredictedLabel - Present for either a BINARY or MULTICLASS MLModel request. // - PredictedScores - Contains the raw classification score corresponding to // each label. // - PredictedValue - Present for a REGRESSION MLModel request. type Prediction struct { // Provides any additional details regarding the prediction. Details map[string]string // The prediction label for either a BINARY or MULTICLASS MLModel . PredictedLabel *string // Provides the raw classification score corresponding to each label. PredictedScores map[string]float32 // The prediction value for REGRESSION MLModel . PredictedValue *float32 noSmithyDocumentSerde } // The database details of an Amazon RDS database. type RDSDatabase struct { // The name of a database hosted on an RDS DB instance. // // This member is required. DatabaseName *string // The ID of an RDS DB instance. // // This member is required. InstanceIdentifier *string noSmithyDocumentSerde } // The database credentials to connect to a database on an RDS DB instance. type RDSDatabaseCredentials struct { // The password to be used by Amazon ML to connect to a database on an RDS DB // instance. The password should have sufficient permissions to execute the // RDSSelectQuery query. // // This member is required. Password *string // The username to be used by Amazon ML to connect to database on an Amazon RDS // instance. The username should have sufficient permissions to execute an // RDSSelectSqlQuery query. // // This member is required. Username *string noSmithyDocumentSerde } // The data specification of an Amazon Relational Database Service (Amazon RDS) // DataSource . type RDSDataSpec struct { // The AWS Identity and Access Management (IAM) credentials that are used connect // to the Amazon RDS database. // // This member is required. DatabaseCredentials *RDSDatabaseCredentials // Describes the DatabaseName and InstanceIdentifier of an Amazon RDS database. // // This member is required. DatabaseInformation *RDSDatabase // The role (DataPipelineDefaultResourceRole) assumed by an Amazon Elastic Compute // Cloud (Amazon EC2) instance to carry out the copy operation from Amazon RDS to // an Amazon S3 task. For more information, see Role templates (https://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/dp-iam-roles.html) // for data pipelines. // // This member is required. ResourceRole *string // The Amazon S3 location for staging Amazon RDS data. The data retrieved from // Amazon RDS using SelectSqlQuery is stored in this location. // // This member is required. S3StagingLocation *string // The security group IDs to be used to access a VPC-based RDS DB instance. Ensure // that there are appropriate ingress rules set up to allow access to the RDS DB // instance. This attribute is used by Data Pipeline to carry out the copy // operation from Amazon RDS to an Amazon S3 task. // // This member is required. SecurityGroupIds []string // The query that is used to retrieve the observation data for the DataSource . // // This member is required. SelectSqlQuery *string // The role (DataPipelineDefaultRole) assumed by AWS Data Pipeline service to // monitor the progress of the copy task from Amazon RDS to Amazon S3. For more // information, see Role templates (https://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/dp-iam-roles.html) // for data pipelines. // // This member is required. ServiceRole *string // The subnet ID to be used to access a VPC-based RDS DB instance. This attribute // is used by Data Pipeline to carry out the copy task from Amazon RDS to Amazon // S3. // // This member is required. SubnetId *string // A JSON string that represents the splitting and rearrangement processing to be // applied to a DataSource . If the DataRearrangement parameter is not provided, // all of the input data is used to create the Datasource . There are multiple // parameters that control what data is used to create a datasource: // - percentBegin Use percentBegin to indicate the beginning of the range of the // data used to create the Datasource. If you do not include percentBegin and // percentEnd , Amazon ML includes all of the data when creating the datasource. // - percentEnd Use percentEnd to indicate the end of the range of the data used // to create the Datasource. If you do not include percentBegin and percentEnd , // Amazon ML includes all of the data when creating the datasource. // - complement The complement parameter instructs Amazon ML to use the data that // is not included in the range of percentBegin to percentEnd to create a // datasource. The complement parameter is useful if you need to create // complementary datasources for training and evaluation. To create a complementary // datasource, use the same values for percentBegin and percentEnd , along with // the complement parameter. For example, the following two datasources do not // share any data, and can be used to train and evaluate a model. The first // datasource has 25 percent of the data, and the second one has 75 percent of the // data. Datasource for evaluation: {"splitting":{"percentBegin":0, // "percentEnd":25}} Datasource for training: {"splitting":{"percentBegin":0, // "percentEnd":25, "complement":"true"}} // - strategy To change how Amazon ML splits the data for a datasource, use the // strategy parameter. The default value for the strategy parameter is sequential // , meaning that Amazon ML takes all of the data records between the // percentBegin and percentEnd parameters for the datasource, in the order that // the records appear in the input data. The following two DataRearrangement // lines are examples of sequentially ordered training and evaluation datasources: // Datasource for evaluation: {"splitting":{"percentBegin":70, "percentEnd":100, // "strategy":"sequential"}} Datasource for training: // {"splitting":{"percentBegin":70, "percentEnd":100, "strategy":"sequential", // "complement":"true"}} To randomly split the input data into the proportions // indicated by the percentBegin and percentEnd parameters, set the strategy // parameter to random and provide a string that is used as the seed value for // the random data splitting (for example, you can use the S3 path to your data as // the random seed string). If you choose the random split strategy, Amazon ML // assigns each row of data a pseudo-random number between 0 and 100, and then // selects the rows that have an assigned number between percentBegin and // percentEnd . Pseudo-random numbers are assigned using both the input seed // string value and the byte offset as a seed, so changing the data results in a // different split. Any existing ordering is preserved. The random splitting // strategy ensures that variables in the training and evaluation data are // distributed similarly. It is useful in the cases where the input data may have // an implicit sort order, which would otherwise result in training and evaluation // datasources containing non-similar data records. The following two // DataRearrangement lines are examples of non-sequentially ordered training and // evaluation datasources: Datasource for evaluation: // {"splitting":{"percentBegin":70, "percentEnd":100, "strategy":"random", // "randomSeed"="s3://my_s3_path/bucket/file.csv"}} Datasource for training: // {"splitting":{"percentBegin":70, "percentEnd":100, "strategy":"random", // "randomSeed"="s3://my_s3_path/bucket/file.csv", "complement":"true"}} DataRearrangement *string // A JSON string that represents the schema for an Amazon RDS DataSource . The // DataSchema defines the structure of the observation data in the data file(s) // referenced in the DataSource . A DataSchema is not required if you specify a // DataSchemaUri Define your DataSchema as a series of key-value pairs. attributes // and excludedVariableNames have an array of key-value pairs for their value. Use // the following format to define your DataSchema . { "version": "1.0", // "recordAnnotationFieldName": "F1", "recordWeightFieldName": "F2", // "targetFieldName": "F3", "dataFormat": "CSV", "dataFileContainsHeader": true, // "attributes": [ { "fieldName": "F1", "fieldType": "TEXT" }, { "fieldName": "F2", // "fieldType": "NUMERIC" }, { "fieldName": "F3", "fieldType": "CATEGORICAL" }, { // "fieldName": "F4", "fieldType": "NUMERIC" }, { "fieldName": "F5", "fieldType": // "CATEGORICAL" }, { "fieldName": "F6", "fieldType": "TEXT" }, { "fieldName": // "F7", "fieldType": "WEIGHTED_INT_SEQUENCE" }, { "fieldName": "F8", "fieldType": // "WEIGHTED_STRING_SEQUENCE" } ], "excludedVariableNames": [ "F6" ] } DataSchema *string // The Amazon S3 location of the DataSchema . DataSchemaUri *string noSmithyDocumentSerde } // The datasource details that are specific to Amazon RDS. type RDSMetadata struct { // The ID of the Data Pipeline instance that is used to carry to copy data from // Amazon RDS to Amazon S3. You can use the ID to find details about the instance // in the Data Pipeline console. DataPipelineId *string // The database details required to connect to an Amazon RDS. Database *RDSDatabase // The username to be used by Amazon ML to connect to database on an Amazon RDS // instance. The username should have sufficient permissions to execute an // RDSSelectSqlQuery query. DatabaseUserName *string // The role (DataPipelineDefaultResourceRole) assumed by an Amazon EC2 instance to // carry out the copy task from Amazon RDS to Amazon S3. For more information, see // Role templates (https://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/dp-iam-roles.html) // for data pipelines. ResourceRole *string // The SQL query that is supplied during CreateDataSourceFromRDS . Returns only if // Verbose is true in GetDataSourceInput . SelectSqlQuery *string // The role (DataPipelineDefaultRole) assumed by the Data Pipeline service to // monitor the progress of the copy task from Amazon RDS to Amazon S3. For more // information, see Role templates (https://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/dp-iam-roles.html) // for data pipelines. ServiceRole *string noSmithyDocumentSerde } // Describes the real-time endpoint information for an MLModel . type RealtimeEndpointInfo struct { // The time that the request to create the real-time endpoint for the MLModel was // received. The time is expressed in epoch time. CreatedAt *time.Time // The current status of the real-time endpoint for the MLModel . This element can // have one of the following values: // - NONE - Endpoint does not exist or was previously deleted. // - READY - Endpoint is ready to be used for real-time predictions. // - UPDATING - Updating/creating the endpoint. EndpointStatus RealtimeEndpointStatus // The URI that specifies where to send real-time prediction requests for the // MLModel . Note: The application must wait until the real-time endpoint is ready // before using this URI. EndpointUrl *string // The maximum processing rate for the real-time endpoint for MLModel , measured in // incoming requests per second. PeakRequestsPerSecond int32 noSmithyDocumentSerde } // Describes the database details required to connect to an Amazon Redshift // database. type RedshiftDatabase struct { // The ID of an Amazon Redshift cluster. // // This member is required. ClusterIdentifier *string // The name of a database hosted on an Amazon Redshift cluster. // // This member is required. DatabaseName *string noSmithyDocumentSerde } // Describes the database credentials for connecting to a database on an Amazon // Redshift cluster. type RedshiftDatabaseCredentials struct { // A password to be used by Amazon ML to connect to a database on an Amazon // Redshift cluster. The password should have sufficient permissions to execute a // RedshiftSelectSqlQuery query. The password should be valid for an Amazon // Redshift USER (https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_USER.html) // . // // This member is required. Password *string // A username to be used by Amazon Machine Learning (Amazon ML)to connect to a // database on an Amazon Redshift cluster. The username should have sufficient // permissions to execute the RedshiftSelectSqlQuery query. The username should be // valid for an Amazon Redshift USER (https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_USER.html) // . // // This member is required. Username *string noSmithyDocumentSerde } // Describes the data specification of an Amazon Redshift DataSource . type RedshiftDataSpec struct { // Describes AWS Identity and Access Management (IAM) credentials that are used // connect to the Amazon Redshift database. // // This member is required. DatabaseCredentials *RedshiftDatabaseCredentials // Describes the DatabaseName and ClusterIdentifier for an Amazon Redshift // DataSource . // // This member is required. DatabaseInformation *RedshiftDatabase // Describes an Amazon S3 location to store the result set of the SelectSqlQuery // query. // // This member is required. S3StagingLocation *string // Describes the SQL Query to execute on an Amazon Redshift database for an Amazon // Redshift DataSource . // // This member is required. SelectSqlQuery *string // A JSON string that represents the splitting and rearrangement processing to be // applied to a DataSource . If the DataRearrangement parameter is not provided, // all of the input data is used to create the Datasource . There are multiple // parameters that control what data is used to create a datasource: // - percentBegin Use percentBegin to indicate the beginning of the range of the // data used to create the Datasource. If you do not include percentBegin and // percentEnd , Amazon ML includes all of the data when creating the datasource. // - percentEnd Use percentEnd to indicate the end of the range of the data used // to create the Datasource. If you do not include percentBegin and percentEnd , // Amazon ML includes all of the data when creating the datasource. // - complement The complement parameter instructs Amazon ML to use the data that // is not included in the range of percentBegin to percentEnd to create a // datasource. The complement parameter is useful if you need to create // complementary datasources for training and evaluation. To create a complementary // datasource, use the same values for percentBegin and percentEnd , along with // the complement parameter. For example, the following two datasources do not // share any data, and can be used to train and evaluate a model. The first // datasource has 25 percent of the data, and the second one has 75 percent of the // data. Datasource for evaluation: {"splitting":{"percentBegin":0, // "percentEnd":25}} Datasource for training: {"splitting":{"percentBegin":0, // "percentEnd":25, "complement":"true"}} // - strategy To change how Amazon ML splits the data for a datasource, use the // strategy parameter. The default value for the strategy parameter is sequential // , meaning that Amazon ML takes all of the data records between the // percentBegin and percentEnd parameters for the datasource, in the order that // the records appear in the input data. The following two DataRearrangement // lines are examples of sequentially ordered training and evaluation datasources: // Datasource for evaluation: {"splitting":{"percentBegin":70, "percentEnd":100, // "strategy":"sequential"}} Datasource for training: // {"splitting":{"percentBegin":70, "percentEnd":100, "strategy":"sequential", // "complement":"true"}} To randomly split the input data into the proportions // indicated by the percentBegin and percentEnd parameters, set the strategy // parameter to random and provide a string that is used as the seed value for // the random data splitting (for example, you can use the S3 path to your data as // the random seed string). If you choose the random split strategy, Amazon ML // assigns each row of data a pseudo-random number between 0 and 100, and then // selects the rows that have an assigned number between percentBegin and // percentEnd . Pseudo-random numbers are assigned using both the input seed // string value and the byte offset as a seed, so changing the data results in a // different split. Any existing ordering is preserved. The random splitting // strategy ensures that variables in the training and evaluation data are // distributed similarly. It is useful in the cases where the input data may have // an implicit sort order, which would otherwise result in training and evaluation // datasources containing non-similar data records. The following two // DataRearrangement lines are examples of non-sequentially ordered training and // evaluation datasources: Datasource for evaluation: // {"splitting":{"percentBegin":70, "percentEnd":100, "strategy":"random", // "randomSeed"="s3://my_s3_path/bucket/file.csv"}} Datasource for training: // {"splitting":{"percentBegin":70, "percentEnd":100, "strategy":"random", // "randomSeed"="s3://my_s3_path/bucket/file.csv", "complement":"true"}} DataRearrangement *string // A JSON string that represents the schema for an Amazon Redshift DataSource . The // DataSchema defines the structure of the observation data in the data file(s) // referenced in the DataSource . A DataSchema is not required if you specify a // DataSchemaUri . Define your DataSchema as a series of key-value pairs. // attributes and excludedVariableNames have an array of key-value pairs for their // value. Use the following format to define your DataSchema . { "version": "1.0", // "recordAnnotationFieldName": "F1", "recordWeightFieldName": "F2", // "targetFieldName": "F3", "dataFormat": "CSV", "dataFileContainsHeader": true, // "attributes": [ { "fieldName": "F1", "fieldType": "TEXT" }, { "fieldName": "F2", // "fieldType": "NUMERIC" }, { "fieldName": "F3", "fieldType": "CATEGORICAL" }, { // "fieldName": "F4", "fieldType": "NUMERIC" }, { "fieldName": "F5", "fieldType": // "CATEGORICAL" }, { "fieldName": "F6", "fieldType": "TEXT" }, { "fieldName": // "F7", "fieldType": "WEIGHTED_INT_SEQUENCE" }, { "fieldName": "F8", "fieldType": // "WEIGHTED_STRING_SEQUENCE" } ], "excludedVariableNames": [ "F6" ] } DataSchema *string // Describes the schema location for an Amazon Redshift DataSource . DataSchemaUri *string noSmithyDocumentSerde } // Describes the DataSource details specific to Amazon Redshift. type RedshiftMetadata struct { // A username to be used by Amazon Machine Learning (Amazon ML)to connect to a // database on an Amazon Redshift cluster. The username should have sufficient // permissions to execute the RedshiftSelectSqlQuery query. The username should be // valid for an Amazon Redshift USER (https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_USER.html) // . DatabaseUserName *string // Describes the database details required to connect to an Amazon Redshift // database. RedshiftDatabase *RedshiftDatabase // The SQL query that is specified during CreateDataSourceFromRedshift . Returns // only if Verbose is true in GetDataSourceInput. SelectSqlQuery *string noSmithyDocumentSerde } // Describes the data specification of a DataSource . type S3DataSpec struct { // The location of the data file(s) used by a DataSource . The URI specifies a data // file or an Amazon Simple Storage Service (Amazon S3) directory or bucket // containing data files. // // This member is required. DataLocationS3 *string // A JSON string that represents the splitting and rearrangement processing to be // applied to a DataSource . If the DataRearrangement parameter is not provided, // all of the input data is used to create the Datasource . There are multiple // parameters that control what data is used to create a datasource: // - percentBegin Use percentBegin to indicate the beginning of the range of the // data used to create the Datasource. If you do not include percentBegin and // percentEnd , Amazon ML includes all of the data when creating the datasource. // - percentEnd Use percentEnd to indicate the end of the range of the data used // to create the Datasource. If you do not include percentBegin and percentEnd , // Amazon ML includes all of the data when creating the datasource. // - complement The complement parameter instructs Amazon ML to use the data that // is not included in the range of percentBegin to percentEnd to create a // datasource. The complement parameter is useful if you need to create // complementary datasources for training and evaluation. To create a complementary // datasource, use the same values for percentBegin and percentEnd , along with // the complement parameter. For example, the following two datasources do not // share any data, and can be used to train and evaluate a model. The first // datasource has 25 percent of the data, and the second one has 75 percent of the // data. Datasource for evaluation: {"splitting":{"percentBegin":0, // "percentEnd":25}} Datasource for training: {"splitting":{"percentBegin":0, // "percentEnd":25, "complement":"true"}} // - strategy To change how Amazon ML splits the data for a datasource, use the // strategy parameter. The default value for the strategy parameter is sequential // , meaning that Amazon ML takes all of the data records between the // percentBegin and percentEnd parameters for the datasource, in the order that // the records appear in the input data. The following two DataRearrangement // lines are examples of sequentially ordered training and evaluation datasources: // Datasource for evaluation: {"splitting":{"percentBegin":70, "percentEnd":100, // "strategy":"sequential"}} Datasource for training: // {"splitting":{"percentBegin":70, "percentEnd":100, "strategy":"sequential", // "complement":"true"}} To randomly split the input data into the proportions // indicated by the percentBegin and percentEnd parameters, set the strategy // parameter to random and provide a string that is used as the seed value for // the random data splitting (for example, you can use the S3 path to your data as // the random seed string). If you choose the random split strategy, Amazon ML // assigns each row of data a pseudo-random number between 0 and 100, and then // selects the rows that have an assigned number between percentBegin and // percentEnd . Pseudo-random numbers are assigned using both the input seed // string value and the byte offset as a seed, so changing the data results in a // different split. Any existing ordering is preserved. The random splitting // strategy ensures that variables in the training and evaluation data are // distributed similarly. It is useful in the cases where the input data may have // an implicit sort order, which would otherwise result in training and evaluation // datasources containing non-similar data records. The following two // DataRearrangement lines are examples of non-sequentially ordered training and // evaluation datasources: Datasource for evaluation: // {"splitting":{"percentBegin":70, "percentEnd":100, "strategy":"random", // "randomSeed"="s3://my_s3_path/bucket/file.csv"}} Datasource for training: // {"splitting":{"percentBegin":70, "percentEnd":100, "strategy":"random", // "randomSeed"="s3://my_s3_path/bucket/file.csv", "complement":"true"}} DataRearrangement *string // A JSON string that represents the schema for an Amazon S3 DataSource . The // DataSchema defines the structure of the observation data in the data file(s) // referenced in the DataSource . You must provide either the DataSchema or the // DataSchemaLocationS3 . Define your DataSchema as a series of key-value pairs. // attributes and excludedVariableNames have an array of key-value pairs for their // value. Use the following format to define your DataSchema . { "version": "1.0", // "recordAnnotationFieldName": "F1", "recordWeightFieldName": "F2", // "targetFieldName": "F3", "dataFormat": "CSV", "dataFileContainsHeader": true, // "attributes": [ { "fieldName": "F1", "fieldType": "TEXT" }, { "fieldName": "F2", // "fieldType": "NUMERIC" }, { "fieldName": "F3", "fieldType": "CATEGORICAL" }, { // "fieldName": "F4", "fieldType": "NUMERIC" }, { "fieldName": "F5", "fieldType": // "CATEGORICAL" }, { "fieldName": "F6", "fieldType": "TEXT" }, { "fieldName": // "F7", "fieldType": "WEIGHTED_INT_SEQUENCE" }, { "fieldName": "F8", "fieldType": // "WEIGHTED_STRING_SEQUENCE" } ], "excludedVariableNames": [ "F6" ] } DataSchema *string // Describes the schema location in Amazon S3. You must provide either the // DataSchema or the DataSchemaLocationS3 . DataSchemaLocationS3 *string noSmithyDocumentSerde } // A custom key-value pair associated with an ML object, such as an ML model. type Tag struct { // A unique identifier for the tag. Valid characters include Unicode letters, // digits, white space, _, ., /, =, +, -, %, and @. Key *string // An optional string, typically used to describe or define the tag. Valid // characters include Unicode letters, digits, white space, _, ., /, =, +, -, %, // and @. Value *string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
884
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "net" "net/http" "time" ) const ServiceID = "Macie" const ServiceAPIVersion = "2017-12-19" // Client provides the API client to make operations call for Amazon Macie. type Client struct { options Options } // New returns an initialized Client based on the functional options. Provide // additional functional options to further configure the behavior of the client, // such as changing the client's endpoint or adding custom middleware behavior. func New(options Options, optFns ...func(*Options)) *Client { options = options.Copy() resolveDefaultLogger(&options) setResolvedDefaultsMode(&options) resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) resolveDefaultEndpointConfiguration(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } return client } type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // Configures the events that will be sent to the configured logger. ClientLogMode aws.ClientLogMode // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The configuration DefaultsMode that the SDK should use when constructing the // clients initial default settings. DefaultsMode aws.DefaultsMode // The endpoint options to be used when attempting to resolve an endpoint. EndpointOptions EndpointResolverOptions // The service endpoint resolver. EndpointResolver EndpointResolver // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 // The logger writer interface to write logging messages to. Logger logging.Logger // The region to send requests to. (Required) Region string // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify // per operation call's retry max attempts. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. If specified in an operation call's functional // options with a value that is different than the constructed client's Options, // the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if // Retryer option is not also specified. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. Currently does not support per operation call // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. The kind of // default retry created by the API client can be changed with the RetryMode // option. Retryer aws.Retryer // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You // should not populate this structure programmatically, or rely on the values here // within your applications. RuntimeEnvironment aws.RuntimeEnvironment // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved // value was at that point in time. Currently does not support per operation call // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient } // WithAPIOptions returns a functional option for setting the Client's APIOptions // option. func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { return func(o *Options) { o.APIOptions = append(o.APIOptions, optFns...) } } // WithEndpointResolver returns a functional option for setting the Client's // EndpointResolver option. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v } } type HTTPClient interface { Do(*http.Request) (*http.Response, error) } // Copy creates a clone where the APIOptions list is deep copied. func (o Options) Copy() Options { to := o to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) copy(to.APIOptions, o.APIOptions) return to } func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err } } for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, metadata, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err = handler.Handle(ctx, params) if err != nil { err = &smithy.OperationError{ ServiceID: ServiceID, OperationName: opID, Err: err, } } return result, metadata, err } type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { if o.Logger != nil { return } o.Logger = logging.Nop{} } func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } func setResolvedDefaultsMode(o *Options) { if len(o.resolvedDefaultsMode) > 0 { return } var mode aws.DefaultsMode mode.SetFromString(string(o.DefaultsMode)) if mode == aws.DefaultsModeAuto { mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) } o.resolvedDefaultsMode = mode } // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, DefaultsMode: cfg.DefaultsMode, RuntimeEnvironment: cfg.RuntimeEnvironment, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { var buildable *awshttp.BuildableClient if o.HTTPClient != nil { var ok bool buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) if !ok { return } } else { buildable = awshttp.NewBuildableClient() } modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { dialer.Timeout = dialerTimeout } }) buildable = buildable.WithTransportOptions(func(transport *http.Transport) { if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { transport.TLSHandshakeTimeout = tlsHandshakeTimeout } }) } o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } if len(o.RetryMode) == 0 { modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { o.RetryMode = modeConfig.RetryMode } } if len(o.RetryMode) == 0 { o.RetryMode = aws.RetryModeStandard } var standardOptions []func(*retry.StandardOptions) if v := o.RetryMaxAttempts; v != 0 { standardOptions = append(standardOptions, func(so *retry.StandardOptions) { so.MaxAttempts = v }) } switch o.RetryMode { case aws.RetryModeAdaptive: var adaptiveOptions []func(*retry.AdaptiveModeOptions) if len(standardOptions) != 0 { adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { ao.StandardOptions = append(ao.StandardOptions, standardOptions...) }) } o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) default: o.Retryer = retry.NewStandard(standardOptions...) } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { if cfg.Retryer == nil { return } o.Retryer = cfg.Retryer() } func resolveAWSRetryMode(cfg aws.Config, o *Options) { if len(cfg.RetryMode) == 0 { return } o.RetryMode = cfg.RetryMode } func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { if cfg.RetryMaxAttempts == 0 { return } o.RetryMaxAttempts = cfg.RetryMaxAttempts } func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } func addClientUserAgent(stack *middleware.Stack) error { return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "macie", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
434
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "io/ioutil" "net/http" "strings" "testing" ) func TestClient_resolveRetryOptions(t *testing.T) { nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { return &http.Response{ StatusCode: 200, Header: http.Header{}, Body: ioutil.NopCloser(strings.NewReader("")), }, nil }) cases := map[string]struct { defaultsMode aws.DefaultsMode retryer aws.Retryer retryMaxAttempts int opRetryMaxAttempts *int retryMode aws.RetryMode expectClientRetryMode aws.RetryMode expectClientMaxAttempts int expectOpMaxAttempts int }{ "defaults": { defaultsMode: aws.DefaultsModeStandard, expectClientRetryMode: aws.RetryModeStandard, expectClientMaxAttempts: 3, expectOpMaxAttempts: 3, }, "custom default retry": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, "custom op max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(2), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 2, }, "custom op no change max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(10), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, "custom op 0 max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(0), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, } for name, c := range cases { t.Run(name, func(t *testing.T) { client := NewFromConfig(aws.Config{ DefaultsMode: c.defaultsMode, Retryer: func() func() aws.Retryer { if c.retryer == nil { return nil } return func() aws.Retryer { return c.retryer } }(), HTTPClient: nopClient, RetryMaxAttempts: c.retryMaxAttempts, RetryMode: c.retryMode, }) if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { t.Errorf("expect %v retry mode, got %v", e, a) } if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { t.Errorf("expect %v max attempts, got %v", e, a) } _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, []func(*Options){ func(o *Options) { if c.opRetryMaxAttempts == nil { return } o.RetryMaxAttempts = *c.opRetryMaxAttempts }, }, func(s *middleware.Stack, o Options) error { s.Initialize.Clear() s.Serialize.Clear() s.Build.Clear() s.Finalize.Clear() s.Deserialize.Clear() if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { t.Errorf("expect %v op max attempts, got %v", e, a) } return nil }) if err != nil { t.Fatalf("expect no operation error, got %v", err) } }) } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // (Discontinued) Associates a specified Amazon Web Services account with Amazon // Macie Classic as a member account. func (c *Client) AssociateMemberAccount(ctx context.Context, params *AssociateMemberAccountInput, optFns ...func(*Options)) (*AssociateMemberAccountOutput, error) { if params == nil { params = &AssociateMemberAccountInput{} } result, metadata, err := c.invokeOperation(ctx, "AssociateMemberAccount", params, optFns, c.addOperationAssociateMemberAccountMiddlewares) if err != nil { return nil, err } out := result.(*AssociateMemberAccountOutput) out.ResultMetadata = metadata return out, nil } type AssociateMemberAccountInput struct { // (Discontinued) The ID of the Amazon Web Services account that you want to // associate with Amazon Macie Classic as a member account. // // This member is required. MemberAccountId *string noSmithyDocumentSerde } type AssociateMemberAccountOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAssociateMemberAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateMemberAccount{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateMemberAccount{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpAssociateMemberAccountValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateMemberAccount(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opAssociateMemberAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie", OperationName: "AssociateMemberAccount", } }
122
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // (Discontinued) Associates specified S3 resources with Amazon Macie Classic for // monitoring and data classification. If memberAccountId isn't specified, the // action associates specified S3 resources with Macie Classic for the current // Macie Classic administrator account. If memberAccountId is specified, the // action associates specified S3 resources with Macie Classic for the specified // member account. func (c *Client) AssociateS3Resources(ctx context.Context, params *AssociateS3ResourcesInput, optFns ...func(*Options)) (*AssociateS3ResourcesOutput, error) { if params == nil { params = &AssociateS3ResourcesInput{} } result, metadata, err := c.invokeOperation(ctx, "AssociateS3Resources", params, optFns, c.addOperationAssociateS3ResourcesMiddlewares) if err != nil { return nil, err } out := result.(*AssociateS3ResourcesOutput) out.ResultMetadata = metadata return out, nil } type AssociateS3ResourcesInput struct { // (Discontinued) The S3 resources that you want to associate with Amazon Macie // Classic for monitoring and data classification. // // This member is required. S3Resources []types.S3ResourceClassification // (Discontinued) The ID of the Amazon Macie Classic member account whose // resources you want to associate with Macie Classic. MemberAccountId *string noSmithyDocumentSerde } type AssociateS3ResourcesOutput struct { // (Discontinued) S3 resources that couldn't be associated with Amazon Macie // Classic. An error code and an error message are provided for each failed item. FailedS3Resources []types.FailedS3Resource // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAssociateS3ResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateS3Resources{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateS3Resources{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpAssociateS3ResourcesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateS3Resources(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opAssociateS3Resources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie", OperationName: "AssociateS3Resources", } }
136
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // (Discontinued) Removes the specified member account from Amazon Macie Classic. func (c *Client) DisassociateMemberAccount(ctx context.Context, params *DisassociateMemberAccountInput, optFns ...func(*Options)) (*DisassociateMemberAccountOutput, error) { if params == nil { params = &DisassociateMemberAccountInput{} } result, metadata, err := c.invokeOperation(ctx, "DisassociateMemberAccount", params, optFns, c.addOperationDisassociateMemberAccountMiddlewares) if err != nil { return nil, err } out := result.(*DisassociateMemberAccountOutput) out.ResultMetadata = metadata return out, nil } type DisassociateMemberAccountInput struct { // (Discontinued) The ID of the member account that you want to remove from Amazon // Macie Classic. // // This member is required. MemberAccountId *string noSmithyDocumentSerde } type DisassociateMemberAccountOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDisassociateMemberAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisassociateMemberAccount{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisassociateMemberAccount{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDisassociateMemberAccountValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateMemberAccount(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opDisassociateMemberAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie", OperationName: "DisassociateMemberAccount", } }
121
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // (Discontinued) Removes specified S3 resources from being monitored by Amazon // Macie Classic. If memberAccountId isn't specified, the action removes specified // S3 resources from Macie Classic for the current Macie Classic administrator // account. If memberAccountId is specified, the action removes specified S3 // resources from Macie Classic for the specified member account. func (c *Client) DisassociateS3Resources(ctx context.Context, params *DisassociateS3ResourcesInput, optFns ...func(*Options)) (*DisassociateS3ResourcesOutput, error) { if params == nil { params = &DisassociateS3ResourcesInput{} } result, metadata, err := c.invokeOperation(ctx, "DisassociateS3Resources", params, optFns, c.addOperationDisassociateS3ResourcesMiddlewares) if err != nil { return nil, err } out := result.(*DisassociateS3ResourcesOutput) out.ResultMetadata = metadata return out, nil } type DisassociateS3ResourcesInput struct { // (Discontinued) The S3 resources (buckets or prefixes) that you want to remove // from being monitored and classified by Amazon Macie Classic. // // This member is required. AssociatedS3Resources []types.S3Resource // (Discontinued) The ID of the Amazon Macie Classic member account whose // resources you want to remove from being monitored by Macie Classic. MemberAccountId *string noSmithyDocumentSerde } type DisassociateS3ResourcesOutput struct { // (Discontinued) S3 resources that couldn't be removed from being monitored and // classified by Amazon Macie Classic. An error code and an error message are // provided for each failed item. FailedS3Resources []types.FailedS3Resource // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDisassociateS3ResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisassociateS3Resources{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisassociateS3Resources{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDisassociateS3ResourcesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateS3Resources(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opDisassociateS3Resources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie", OperationName: "DisassociateS3Resources", } }
136
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // (Discontinued) Lists all Amazon Macie Classic member accounts for the current // Macie Classic administrator account. func (c *Client) ListMemberAccounts(ctx context.Context, params *ListMemberAccountsInput, optFns ...func(*Options)) (*ListMemberAccountsOutput, error) { if params == nil { params = &ListMemberAccountsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListMemberAccounts", params, optFns, c.addOperationListMemberAccountsMiddlewares) if err != nil { return nil, err } out := result.(*ListMemberAccountsOutput) out.ResultMetadata = metadata return out, nil } type ListMemberAccountsInput struct { // (Discontinued) Use this parameter to indicate the maximum number of items that // you want in the response. The default value is 250. MaxResults *int32 // (Discontinued) Use this parameter when paginating results. Set the value of // this parameter to null on your first call to the ListMemberAccounts action. // Subsequent calls to the action fill nextToken in the request with the value of // nextToken from the previous response to continue listing data. NextToken *string noSmithyDocumentSerde } type ListMemberAccountsOutput struct { // (Discontinued) A list of the Amazon Macie Classic member accounts returned by // the action. The current Macie Classic administrator account is also included in // this list. MemberAccounts []types.MemberAccount // (Discontinued) When a response is generated, if there is more data to be // listed, this parameter is present in the response and contains the value to use // for the nextToken parameter in a subsequent pagination request. If there is no // more data to be listed, this parameter is set to null. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListMemberAccountsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListMemberAccounts{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListMemberAccounts{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListMemberAccounts(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListMemberAccountsAPIClient is a client that implements the ListMemberAccounts // operation. type ListMemberAccountsAPIClient interface { ListMemberAccounts(context.Context, *ListMemberAccountsInput, ...func(*Options)) (*ListMemberAccountsOutput, error) } var _ ListMemberAccountsAPIClient = (*Client)(nil) // ListMemberAccountsPaginatorOptions is the paginator options for // ListMemberAccounts type ListMemberAccountsPaginatorOptions struct { // (Discontinued) Use this parameter to indicate the maximum number of items that // you want in the response. The default value is 250. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListMemberAccountsPaginator is a paginator for ListMemberAccounts type ListMemberAccountsPaginator struct { options ListMemberAccountsPaginatorOptions client ListMemberAccountsAPIClient params *ListMemberAccountsInput nextToken *string firstPage bool } // NewListMemberAccountsPaginator returns a new ListMemberAccountsPaginator func NewListMemberAccountsPaginator(client ListMemberAccountsAPIClient, params *ListMemberAccountsInput, optFns ...func(*ListMemberAccountsPaginatorOptions)) *ListMemberAccountsPaginator { if params == nil { params = &ListMemberAccountsInput{} } options := ListMemberAccountsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListMemberAccountsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListMemberAccountsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListMemberAccounts page. func (p *ListMemberAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMemberAccountsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxResults = limit result, err := p.client.ListMemberAccounts(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListMemberAccounts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie", OperationName: "ListMemberAccounts", } }
229
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // (Discontinued) Lists all the S3 resources associated with Amazon Macie Classic. // If memberAccountId isn't specified, the action lists the S3 resources // associated with Macie Classic for the current Macie Classic administrator // account. If memberAccountId is specified, the action lists the S3 resources // associated with Macie Classic for the specified member account. func (c *Client) ListS3Resources(ctx context.Context, params *ListS3ResourcesInput, optFns ...func(*Options)) (*ListS3ResourcesOutput, error) { if params == nil { params = &ListS3ResourcesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListS3Resources", params, optFns, c.addOperationListS3ResourcesMiddlewares) if err != nil { return nil, err } out := result.(*ListS3ResourcesOutput) out.ResultMetadata = metadata return out, nil } type ListS3ResourcesInput struct { // (Discontinued) Use this parameter to indicate the maximum number of items that // you want in the response. The default value is 250. MaxResults *int32 // (Discontinued) The Amazon Macie Classic member account ID whose associated S3 // resources you want to list. MemberAccountId *string // (Discontinued) Use this parameter when paginating results. Set its value to // null on your first call to the ListS3Resources action. Subsequent calls to the // action fill nextToken in the request with the value of nextToken from the // previous response to continue listing data. NextToken *string noSmithyDocumentSerde } type ListS3ResourcesOutput struct { // (Discontinued) When a response is generated, if there is more data to be // listed, this parameter is present in the response and contains the value to use // for the nextToken parameter in a subsequent pagination request. If there is no // more data to be listed, this parameter is set to null. NextToken *string // (Discontinued) A list of the associated S3 resources returned by the action. S3Resources []types.S3ResourceClassification // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListS3ResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListS3Resources{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListS3Resources{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListS3Resources(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListS3ResourcesAPIClient is a client that implements the ListS3Resources // operation. type ListS3ResourcesAPIClient interface { ListS3Resources(context.Context, *ListS3ResourcesInput, ...func(*Options)) (*ListS3ResourcesOutput, error) } var _ ListS3ResourcesAPIClient = (*Client)(nil) // ListS3ResourcesPaginatorOptions is the paginator options for ListS3Resources type ListS3ResourcesPaginatorOptions struct { // (Discontinued) Use this parameter to indicate the maximum number of items that // you want in the response. The default value is 250. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListS3ResourcesPaginator is a paginator for ListS3Resources type ListS3ResourcesPaginator struct { options ListS3ResourcesPaginatorOptions client ListS3ResourcesAPIClient params *ListS3ResourcesInput nextToken *string firstPage bool } // NewListS3ResourcesPaginator returns a new ListS3ResourcesPaginator func NewListS3ResourcesPaginator(client ListS3ResourcesAPIClient, params *ListS3ResourcesInput, optFns ...func(*ListS3ResourcesPaginatorOptions)) *ListS3ResourcesPaginator { if params == nil { params = &ListS3ResourcesInput{} } options := ListS3ResourcesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListS3ResourcesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListS3ResourcesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListS3Resources page. func (p *ListS3ResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListS3ResourcesOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxResults = limit result, err := p.client.ListS3Resources(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListS3Resources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie", OperationName: "ListS3Resources", } }
233
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // (Discontinued) Updates the classification types for the specified S3 resources. // If memberAccountId isn't specified, the action updates the classification types // of the S3 resources associated with Amazon Macie Classic for the current Macie // Classic administrator account. If memberAccountId is specified, the action // updates the classification types of the S3 resources associated with Macie // Classic for the specified member account. func (c *Client) UpdateS3Resources(ctx context.Context, params *UpdateS3ResourcesInput, optFns ...func(*Options)) (*UpdateS3ResourcesOutput, error) { if params == nil { params = &UpdateS3ResourcesInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateS3Resources", params, optFns, c.addOperationUpdateS3ResourcesMiddlewares) if err != nil { return nil, err } out := result.(*UpdateS3ResourcesOutput) out.ResultMetadata = metadata return out, nil } type UpdateS3ResourcesInput struct { // (Discontinued) The S3 resources whose classification types you want to update. // // This member is required. S3ResourcesUpdate []types.S3ResourceClassificationUpdate // (Discontinued) The Amazon Web Services account ID of the Amazon Macie Classic // member account whose S3 resources' classification types you want to update. MemberAccountId *string noSmithyDocumentSerde } type UpdateS3ResourcesOutput struct { // (Discontinued) The S3 resources whose classification types can't be updated. An // error code and an error message are provided for each failed item. FailedS3Resources []types.FailedS3Resource // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateS3ResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateS3Resources{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateS3Resources{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateS3ResourcesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateS3Resources(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opUpdateS3Resources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie", OperationName: "UpdateS3Resources", } }
135
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/macie/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "io/ioutil" "strings" ) type awsAwsjson11_deserializeOpAssociateMemberAccount struct { } func (*awsAwsjson11_deserializeOpAssociateMemberAccount) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpAssociateMemberAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorAssociateMemberAccount(response, &metadata) } output := &AssociateMemberAccountOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } func awsAwsjson11_deserializeOpErrorAssociateMemberAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsAwsjson11_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpAssociateS3Resources struct { } func (*awsAwsjson11_deserializeOpAssociateS3Resources) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpAssociateS3Resources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorAssociateS3Resources(response, &metadata) } output := &AssociateS3ResourcesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentAssociateS3ResourcesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorAssociateS3Resources(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsAwsjson11_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDisassociateMemberAccount struct { } func (*awsAwsjson11_deserializeOpDisassociateMemberAccount) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDisassociateMemberAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorDisassociateMemberAccount(response, &metadata) } output := &DisassociateMemberAccountOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } func awsAwsjson11_deserializeOpErrorDisassociateMemberAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsAwsjson11_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDisassociateS3Resources struct { } func (*awsAwsjson11_deserializeOpDisassociateS3Resources) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDisassociateS3Resources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorDisassociateS3Resources(response, &metadata) } output := &DisassociateS3ResourcesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentDisassociateS3ResourcesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorDisassociateS3Resources(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsAwsjson11_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListMemberAccounts struct { } func (*awsAwsjson11_deserializeOpListMemberAccounts) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListMemberAccounts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorListMemberAccounts(response, &metadata) } output := &ListMemberAccountsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentListMemberAccountsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorListMemberAccounts(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsAwsjson11_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListS3Resources struct { } func (*awsAwsjson11_deserializeOpListS3Resources) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListS3Resources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorListS3Resources(response, &metadata) } output := &ListS3ResourcesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentListS3ResourcesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorListS3Resources(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsAwsjson11_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateS3Resources struct { } func (*awsAwsjson11_deserializeOpUpdateS3Resources) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateS3Resources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorUpdateS3Resources(response, &metadata) } output := &UpdateS3ResourcesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentUpdateS3ResourcesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorUpdateS3Resources(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsAwsjson11_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsAwsjson11_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.AccessDeniedException{} err := awsAwsjson11_deserializeDocumentAccessDeniedException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorInternalException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.InternalException{} err := awsAwsjson11_deserializeDocumentInternalException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorInvalidInputException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.InvalidInputException{} err := awsAwsjson11_deserializeDocumentInvalidInputException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.LimitExceededException{} err := awsAwsjson11_deserializeDocumentLimitExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AccessDeniedException if *v == nil { sv = &types.AccessDeniedException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "resourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentClassificationType(v **types.ClassificationType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ClassificationType if *v == nil { sv = &types.ClassificationType{} } else { sv = *v } for key, value := range shape { switch key { case "continuous": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3ContinuousClassificationType to be of type string, got %T instead", value) } sv.Continuous = types.S3ContinuousClassificationType(jtv) } case "oneTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3OneTimeClassificationType to be of type string, got %T instead", value) } sv.OneTime = types.S3OneTimeClassificationType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentFailedS3Resource(v **types.FailedS3Resource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FailedS3Resource if *v == nil { sv = &types.FailedS3Resource{} } else { sv = *v } for key, value := range shape { switch key { case "errorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } sv.ErrorCode = ptr.String(jtv) } case "errorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "failedItem": if err := awsAwsjson11_deserializeDocumentS3Resource(&sv.FailedItem, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentFailedS3Resources(v *[]types.FailedS3Resource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.FailedS3Resource if *v == nil { cv = []types.FailedS3Resource{} } else { cv = *v } for _, value := range shape { var col types.FailedS3Resource destAddr := &col if err := awsAwsjson11_deserializeDocumentFailedS3Resource(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentInternalException(v **types.InternalException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InternalException if *v == nil { sv = &types.InternalException{} } else { sv = *v } for key, value := range shape { switch key { case "errorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } sv.ErrorCode_ = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentInvalidInputException(v **types.InvalidInputException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InvalidInputException if *v == nil { sv = &types.InvalidInputException{} } else { sv = *v } for key, value := range shape { switch key { case "errorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } sv.ErrorCode_ = ptr.String(jtv) } case "fieldName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) } sv.FieldName = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LimitExceededException if *v == nil { sv = &types.LimitExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "errorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } sv.ErrorCode_ = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "resourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentMemberAccount(v **types.MemberAccount, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MemberAccount if *v == nil { sv = &types.MemberAccount{} } else { sv = *v } for key, value := range shape { switch key { case "accountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AWSAccountId to be of type string, got %T instead", value) } sv.AccountId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentMemberAccounts(v *[]types.MemberAccount, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.MemberAccount if *v == nil { cv = []types.MemberAccount{} } else { cv = *v } for _, value := range shape { var col types.MemberAccount destAddr := &col if err := awsAwsjson11_deserializeDocumentMemberAccount(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentS3Resource(v **types.S3Resource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.S3Resource if *v == nil { sv = &types.S3Resource{} } else { sv = *v } for key, value := range shape { switch key { case "bucketName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BucketName to be of type string, got %T instead", value) } sv.BucketName = ptr.String(jtv) } case "prefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Prefix to be of type string, got %T instead", value) } sv.Prefix = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentS3ResourceClassification(v **types.S3ResourceClassification, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.S3ResourceClassification if *v == nil { sv = &types.S3ResourceClassification{} } else { sv = *v } for key, value := range shape { switch key { case "bucketName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BucketName to be of type string, got %T instead", value) } sv.BucketName = ptr.String(jtv) } case "classificationType": if err := awsAwsjson11_deserializeDocumentClassificationType(&sv.ClassificationType, value); err != nil { return err } case "prefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Prefix to be of type string, got %T instead", value) } sv.Prefix = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentS3ResourcesClassification(v *[]types.S3ResourceClassification, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.S3ResourceClassification if *v == nil { cv = []types.S3ResourceClassification{} } else { cv = *v } for _, value := range shape { var col types.S3ResourceClassification destAddr := &col if err := awsAwsjson11_deserializeDocumentS3ResourceClassification(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeOpDocumentAssociateS3ResourcesOutput(v **AssociateS3ResourcesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *AssociateS3ResourcesOutput if *v == nil { sv = &AssociateS3ResourcesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "failedS3Resources": if err := awsAwsjson11_deserializeDocumentFailedS3Resources(&sv.FailedS3Resources, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDisassociateS3ResourcesOutput(v **DisassociateS3ResourcesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DisassociateS3ResourcesOutput if *v == nil { sv = &DisassociateS3ResourcesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "failedS3Resources": if err := awsAwsjson11_deserializeDocumentFailedS3Resources(&sv.FailedS3Resources, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListMemberAccountsOutput(v **ListMemberAccountsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListMemberAccountsOutput if *v == nil { sv = &ListMemberAccountsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "memberAccounts": if err := awsAwsjson11_deserializeDocumentMemberAccounts(&sv.MemberAccounts, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListS3ResourcesOutput(v **ListS3ResourcesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListS3ResourcesOutput if *v == nil { sv = &ListS3ResourcesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "s3Resources": if err := awsAwsjson11_deserializeDocumentS3ResourcesClassification(&sv.S3Resources, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateS3ResourcesOutput(v **UpdateS3ResourcesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateS3ResourcesOutput if *v == nil { sv = &UpdateS3ResourcesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "failedS3Resources": if err := awsAwsjson11_deserializeDocumentFailedS3Resources(&sv.FailedS3Resources, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil }
1,693
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package macie provides the API client, operations, and parameter types for // Amazon Macie. // // Amazon Macie Classic Amazon Macie Classic has been discontinued and is no // longer available. A new Amazon Macie is now available with significant design // improvements and additional features, at a lower price and in most Amazon Web // Services Regions. We encourage you to take advantage of the new and improved // features, and benefit from the reduced cost. To learn about features and pricing // for the new Macie, see Amazon Macie (http://aws.amazon.com/macie/) . To learn // how to use the new Macie, see the Amazon Macie User Guide (https://docs.aws.amazon.com/macie/latest/user/what-is-macie.html) // . package macie
15
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie import ( "context" "errors" "fmt" "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" internalendpoints "github.com/aws/aws-sdk-go-v2/service/macie/internal/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "net/url" "strings" ) // EndpointResolverOptions is the service endpoint resolver options type EndpointResolverOptions = internalendpoints.Options // EndpointResolver interface for resolving service endpoints. type EndpointResolver interface { ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) } var _ EndpointResolver = &internalendpoints.Resolver{} // NewDefaultEndpointResolver constructs a new service endpoint resolver func NewDefaultEndpointResolver() *internalendpoints.Resolver { return internalendpoints.New() } // EndpointResolverFunc is a helper utility that wraps a function so it satisfies // the EndpointResolver interface. This is useful when you want to add additional // endpoint resolving logic, or stub out specific endpoints with custom values. type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { return fn(region, options) } func resolveDefaultEndpointConfiguration(o *Options) { if o.EndpointResolver != nil { return } o.EndpointResolver = NewDefaultEndpointResolver() } // EndpointResolverFromURL returns an EndpointResolver configured using the // provided endpoint url. By default, the resolved endpoint resolver uses the // client region as signing region, and the endpoint source is set to // EndpointSourceCustom.You can provide functional options to configure endpoint // values for the resolved endpoint. func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} for _, fn := range optFns { fn(&e) } return EndpointResolverFunc( func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { if len(e.SigningRegion) == 0 { e.SigningRegion = region } return e, nil }, ) } type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions } func (*ResolveEndpoint) ID() string { return "ResolveEndpoint" } func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } if m.Resolver == nil { return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") } eo := m.Options eo.Logger = middleware.GetLogger(ctx) var endpoint aws.Endpoint endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) if err != nil { return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) } req.URL, err = url.Parse(endpoint.URL) if err != nil { return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) } if len(awsmiddleware.GetSigningName(ctx)) == 0 { signingName := endpoint.SigningName if len(signingName) == 0 { signingName = "macie" } ctx = awsmiddleware.SetSigningName(ctx, signingName) } ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { return stack.Serialize.Insert(&ResolveEndpoint{ Resolver: o.EndpointResolver, Options: o.EndpointOptions, }, "OperationSerializer", middleware.Before) } func removeResolveEndpointMiddleware(stack *middleware.Stack) error { _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) return err } type wrappedEndpointResolver struct { awsResolver aws.EndpointResolverWithOptions resolver EndpointResolver } func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { if w.awsResolver == nil { goto fallback } endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) if err == nil { return endpoint, nil } if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { return endpoint, err } fallback: if w.resolver == nil { return endpoint, fmt.Errorf("default endpoint resolver provided was nil") } return w.resolver.ResolveEndpoint(region, options) } type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { return a(service, region) } var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) // withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver. // If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided // fallbackResolver for resolution. // // fallbackResolver must not be nil func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { var resolver aws.EndpointResolverWithOptions if awsResolverWithOptions != nil { resolver = awsResolverWithOptions } else if awsResolver != nil { resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) } return &wrappedEndpointResolver{ awsResolver: resolver, resolver: fallbackResolver, } } func finalizeClientEndpointResolverOptions(options *Options) { options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() if len(options.EndpointOptions.ResolvedRegion) == 0 { const fipsInfix = "-fips-" const fipsPrefix = "fips-" const fipsSuffix = "-fips" if strings.Contains(options.Region, fipsInfix) || strings.Contains(options.Region, fipsPrefix) || strings.Contains(options.Region, fipsSuffix) { options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled } } }
201
aws-sdk-go-v2
aws
Go
// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. package macie // goModuleVersion is the tagged release for this module const goModuleVersion = "1.15.12"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/macie/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "path" ) type awsAwsjson11_serializeOpAssociateMemberAccount struct { } func (*awsAwsjson11_serializeOpAssociateMemberAccount) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpAssociateMemberAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*AssociateMemberAccountInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MacieService.AssociateMemberAccount") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentAssociateMemberAccountInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpAssociateS3Resources struct { } func (*awsAwsjson11_serializeOpAssociateS3Resources) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpAssociateS3Resources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*AssociateS3ResourcesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MacieService.AssociateS3Resources") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentAssociateS3ResourcesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDisassociateMemberAccount struct { } func (*awsAwsjson11_serializeOpDisassociateMemberAccount) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDisassociateMemberAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisassociateMemberAccountInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MacieService.DisassociateMemberAccount") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDisassociateMemberAccountInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDisassociateS3Resources struct { } func (*awsAwsjson11_serializeOpDisassociateS3Resources) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDisassociateS3Resources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisassociateS3ResourcesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MacieService.DisassociateS3Resources") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDisassociateS3ResourcesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpListMemberAccounts struct { } func (*awsAwsjson11_serializeOpListMemberAccounts) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListMemberAccounts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListMemberAccountsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MacieService.ListMemberAccounts") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListMemberAccountsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpListS3Resources struct { } func (*awsAwsjson11_serializeOpListS3Resources) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListS3Resources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListS3ResourcesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MacieService.ListS3Resources") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListS3ResourcesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpUpdateS3Resources struct { } func (*awsAwsjson11_serializeOpUpdateS3Resources) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateS3Resources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateS3ResourcesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MacieService.UpdateS3Resources") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateS3ResourcesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsAwsjson11_serializeDocumentClassificationType(v *types.ClassificationType, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Continuous) > 0 { ok := object.Key("continuous") ok.String(string(v.Continuous)) } if len(v.OneTime) > 0 { ok := object.Key("oneTime") ok.String(string(v.OneTime)) } return nil } func awsAwsjson11_serializeDocumentClassificationTypeUpdate(v *types.ClassificationTypeUpdate, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Continuous) > 0 { ok := object.Key("continuous") ok.String(string(v.Continuous)) } if len(v.OneTime) > 0 { ok := object.Key("oneTime") ok.String(string(v.OneTime)) } return nil } func awsAwsjson11_serializeDocumentS3Resource(v *types.S3Resource, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BucketName != nil { ok := object.Key("bucketName") ok.String(*v.BucketName) } if v.Prefix != nil { ok := object.Key("prefix") ok.String(*v.Prefix) } return nil } func awsAwsjson11_serializeDocumentS3ResourceClassification(v *types.S3ResourceClassification, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BucketName != nil { ok := object.Key("bucketName") ok.String(*v.BucketName) } if v.ClassificationType != nil { ok := object.Key("classificationType") if err := awsAwsjson11_serializeDocumentClassificationType(v.ClassificationType, ok); err != nil { return err } } if v.Prefix != nil { ok := object.Key("prefix") ok.String(*v.Prefix) } return nil } func awsAwsjson11_serializeDocumentS3ResourceClassificationUpdate(v *types.S3ResourceClassificationUpdate, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BucketName != nil { ok := object.Key("bucketName") ok.String(*v.BucketName) } if v.ClassificationTypeUpdate != nil { ok := object.Key("classificationTypeUpdate") if err := awsAwsjson11_serializeDocumentClassificationTypeUpdate(v.ClassificationTypeUpdate, ok); err != nil { return err } } if v.Prefix != nil { ok := object.Key("prefix") ok.String(*v.Prefix) } return nil } func awsAwsjson11_serializeDocumentS3Resources(v []types.S3Resource, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentS3Resource(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentS3ResourcesClassification(v []types.S3ResourceClassification, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentS3ResourceClassification(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentS3ResourcesClassificationUpdate(v []types.S3ResourceClassificationUpdate, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentS3ResourceClassificationUpdate(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentAssociateMemberAccountInput(v *AssociateMemberAccountInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MemberAccountId != nil { ok := object.Key("memberAccountId") ok.String(*v.MemberAccountId) } return nil } func awsAwsjson11_serializeOpDocumentAssociateS3ResourcesInput(v *AssociateS3ResourcesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MemberAccountId != nil { ok := object.Key("memberAccountId") ok.String(*v.MemberAccountId) } if v.S3Resources != nil { ok := object.Key("s3Resources") if err := awsAwsjson11_serializeDocumentS3ResourcesClassification(v.S3Resources, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentDisassociateMemberAccountInput(v *DisassociateMemberAccountInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MemberAccountId != nil { ok := object.Key("memberAccountId") ok.String(*v.MemberAccountId) } return nil } func awsAwsjson11_serializeOpDocumentDisassociateS3ResourcesInput(v *DisassociateS3ResourcesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssociatedS3Resources != nil { ok := object.Key("associatedS3Resources") if err := awsAwsjson11_serializeDocumentS3Resources(v.AssociatedS3Resources, ok); err != nil { return err } } if v.MemberAccountId != nil { ok := object.Key("memberAccountId") ok.String(*v.MemberAccountId) } return nil } func awsAwsjson11_serializeOpDocumentListMemberAccountsInput(v *ListMemberAccountsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } return nil } func awsAwsjson11_serializeOpDocumentListS3ResourcesInput(v *ListS3ResourcesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.MemberAccountId != nil { ok := object.Key("memberAccountId") ok.String(*v.MemberAccountId) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } return nil } func awsAwsjson11_serializeOpDocumentUpdateS3ResourcesInput(v *UpdateS3ResourcesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MemberAccountId != nil { ok := object.Key("memberAccountId") ok.String(*v.MemberAccountId) } if v.S3ResourcesUpdate != nil { ok := object.Key("s3ResourcesUpdate") if err := awsAwsjson11_serializeDocumentS3ResourcesClassificationUpdate(v.S3ResourcesUpdate, ok); err != nil { return err } } return nil }
659
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/macie/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpAssociateMemberAccount struct { } func (*validateOpAssociateMemberAccount) ID() string { return "OperationInputValidation" } func (m *validateOpAssociateMemberAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AssociateMemberAccountInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAssociateMemberAccountInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpAssociateS3Resources struct { } func (*validateOpAssociateS3Resources) ID() string { return "OperationInputValidation" } func (m *validateOpAssociateS3Resources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AssociateS3ResourcesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAssociateS3ResourcesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisassociateMemberAccount struct { } func (*validateOpDisassociateMemberAccount) ID() string { return "OperationInputValidation" } func (m *validateOpDisassociateMemberAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisassociateMemberAccountInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisassociateMemberAccountInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisassociateS3Resources struct { } func (*validateOpDisassociateS3Resources) ID() string { return "OperationInputValidation" } func (m *validateOpDisassociateS3Resources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisassociateS3ResourcesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisassociateS3ResourcesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateS3Resources struct { } func (*validateOpUpdateS3Resources) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateS3Resources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateS3ResourcesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateS3ResourcesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpAssociateMemberAccountValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociateMemberAccount{}, middleware.After) } func addOpAssociateS3ResourcesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociateS3Resources{}, middleware.After) } func addOpDisassociateMemberAccountValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisassociateMemberAccount{}, middleware.After) } func addOpDisassociateS3ResourcesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisassociateS3Resources{}, middleware.After) } func addOpUpdateS3ResourcesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateS3Resources{}, middleware.After) } func validateClassificationType(v *types.ClassificationType) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ClassificationType"} if len(v.OneTime) == 0 { invalidParams.Add(smithy.NewErrParamRequired("OneTime")) } if len(v.Continuous) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Continuous")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3Resource(v *types.S3Resource) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3Resource"} if v.BucketName == nil { invalidParams.Add(smithy.NewErrParamRequired("BucketName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3ResourceClassification(v *types.S3ResourceClassification) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3ResourceClassification"} if v.BucketName == nil { invalidParams.Add(smithy.NewErrParamRequired("BucketName")) } if v.ClassificationType == nil { invalidParams.Add(smithy.NewErrParamRequired("ClassificationType")) } else if v.ClassificationType != nil { if err := validateClassificationType(v.ClassificationType); err != nil { invalidParams.AddNested("ClassificationType", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3ResourceClassificationUpdate(v *types.S3ResourceClassificationUpdate) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3ResourceClassificationUpdate"} if v.BucketName == nil { invalidParams.Add(smithy.NewErrParamRequired("BucketName")) } if v.ClassificationTypeUpdate == nil { invalidParams.Add(smithy.NewErrParamRequired("ClassificationTypeUpdate")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3Resources(v []types.S3Resource) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3Resources"} for i := range v { if err := validateS3Resource(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3ResourcesClassification(v []types.S3ResourceClassification) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3ResourcesClassification"} for i := range v { if err := validateS3ResourceClassification(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3ResourcesClassificationUpdate(v []types.S3ResourceClassificationUpdate) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3ResourcesClassificationUpdate"} for i := range v { if err := validateS3ResourceClassificationUpdate(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAssociateMemberAccountInput(v *AssociateMemberAccountInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AssociateMemberAccountInput"} if v.MemberAccountId == nil { invalidParams.Add(smithy.NewErrParamRequired("MemberAccountId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAssociateS3ResourcesInput(v *AssociateS3ResourcesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AssociateS3ResourcesInput"} if v.S3Resources == nil { invalidParams.Add(smithy.NewErrParamRequired("S3Resources")) } else if v.S3Resources != nil { if err := validateS3ResourcesClassification(v.S3Resources); err != nil { invalidParams.AddNested("S3Resources", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisassociateMemberAccountInput(v *DisassociateMemberAccountInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisassociateMemberAccountInput"} if v.MemberAccountId == nil { invalidParams.Add(smithy.NewErrParamRequired("MemberAccountId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisassociateS3ResourcesInput(v *DisassociateS3ResourcesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisassociateS3ResourcesInput"} if v.AssociatedS3Resources == nil { invalidParams.Add(smithy.NewErrParamRequired("AssociatedS3Resources")) } else if v.AssociatedS3Resources != nil { if err := validateS3Resources(v.AssociatedS3Resources); err != nil { invalidParams.AddNested("AssociatedS3Resources", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateS3ResourcesInput(v *UpdateS3ResourcesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateS3ResourcesInput"} if v.S3ResourcesUpdate == nil { invalidParams.Add(smithy.NewErrParamRequired("S3ResourcesUpdate")) } else if v.S3ResourcesUpdate != nil { if err := validateS3ResourcesClassificationUpdate(v.S3ResourcesUpdate); err != nil { invalidParams.AddNested("S3ResourcesUpdate", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
343
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package endpoints import ( "github.com/aws/aws-sdk-go-v2/aws" endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" "github.com/aws/smithy-go/logging" "regexp" ) // Options is the endpoint resolver configuration options type Options struct { // Logger is a logging implementation that log events should be sent to. Logger logging.Logger // LogDeprecated indicates that deprecated endpoints should be logged to the // provided logger. LogDeprecated bool // ResolvedRegion is used to override the region to be resolved, rather then the // using the value passed to the ResolveEndpoint method. This value is used by the // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative // name. You must not set this value directly in your application. ResolvedRegion string // DisableHTTPS informs the resolver to return an endpoint that does not use the // HTTPS scheme. DisableHTTPS bool // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. UseDualStackEndpoint aws.DualStackEndpointState // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. UseFIPSEndpoint aws.FIPSEndpointState } func (o Options) GetResolvedRegion() string { return o.ResolvedRegion } func (o Options) GetDisableHTTPS() bool { return o.DisableHTTPS } func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { return o.UseDualStackEndpoint } func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { return o.UseFIPSEndpoint } func transformToSharedOptions(options Options) endpoints.Options { return endpoints.Options{ Logger: options.Logger, LogDeprecated: options.LogDeprecated, ResolvedRegion: options.ResolvedRegion, DisableHTTPS: options.DisableHTTPS, UseDualStackEndpoint: options.UseDualStackEndpoint, UseFIPSEndpoint: options.UseFIPSEndpoint, } } // Resolver Macie endpoint resolver type Resolver struct { partitions endpoints.Partitions } // ResolveEndpoint resolves the service endpoint for the given region and options func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { if len(region) == 0 { return endpoint, &aws.MissingRegionError{} } opt := transformToSharedOptions(options) return r.partitions.ResolveEndpoint(region, opt) } // New returns a new Resolver func New() *Resolver { return &Resolver{ partitions: defaultPartitions, } } var partitionRegexp = struct { Aws *regexp.Regexp AwsCn *regexp.Regexp AwsIso *regexp.Regexp AwsIsoB *regexp.Regexp AwsIsoE *regexp.Regexp AwsIsoF *regexp.Regexp AwsUsGov *regexp.Regexp }{ Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), } var defaultPartitions = endpoints.Partitions{ { ID: "aws", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "macie.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "macie-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "macie-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "macie.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "fips-us-east-1", }: endpoints.Endpoint{ Hostname: "macie-fips.us-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-west-2", }: endpoints.Endpoint{ Hostname: "macie-fips.us-west-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-2", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", Variant: endpoints.FIPSVariant, }: { Hostname: "macie-fips.us-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", Variant: endpoints.FIPSVariant, }: { Hostname: "macie-fips.us-west-2.amazonaws.com", }, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "macie.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "macie-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "macie-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "macie.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, }, { ID: "aws-iso", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "macie-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "macie.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, }, { ID: "aws-iso-b", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "macie-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "macie.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, }, { ID: "aws-iso-e", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "macie-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "macie.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoE, IsRegionalized: true, }, { ID: "aws-iso-f", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "macie-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "macie.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoF, IsRegionalized: true, }, { ID: "aws-us-gov", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "macie.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "macie-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "macie-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "macie.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
335
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package endpoints import ( "testing" ) func TestRegexCompile(t *testing.T) { _ = defaultPartitions }
12
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types type S3ContinuousClassificationType string // Enum values for S3ContinuousClassificationType const ( S3ContinuousClassificationTypeFull S3ContinuousClassificationType = "FULL" ) // Values returns all known values for S3ContinuousClassificationType. Note that // this can be expanded in the future, and so it is only as up to date as the // client. The ordering of this slice is not guaranteed to be stable across // updates. func (S3ContinuousClassificationType) Values() []S3ContinuousClassificationType { return []S3ContinuousClassificationType{ "FULL", } } type S3OneTimeClassificationType string // Enum values for S3OneTimeClassificationType const ( S3OneTimeClassificationTypeFull S3OneTimeClassificationType = "FULL" S3OneTimeClassificationTypeNone S3OneTimeClassificationType = "NONE" ) // Values returns all known values for S3OneTimeClassificationType. Note that this // can be expanded in the future, and so it is only as up to date as the client. // The ordering of this slice is not guaranteed to be stable across updates. func (S3OneTimeClassificationType) Values() []S3OneTimeClassificationType { return []S3OneTimeClassificationType{ "FULL", "NONE", } }
39
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( "fmt" smithy "github.com/aws/smithy-go" ) // (Discontinued) You do not have required permissions to access the requested // resource. type AccessDeniedException struct { Message *string ErrorCodeOverride *string ResourceType *string noSmithyDocumentSerde } func (e *AccessDeniedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccessDeniedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccessDeniedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccessDeniedException" } return *e.ErrorCodeOverride } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // (Discontinued) Internal server error. type InternalException struct { Message *string ErrorCodeOverride *string ErrorCode_ *string noSmithyDocumentSerde } func (e *InternalException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalException" } return *e.ErrorCodeOverride } func (e *InternalException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // (Discontinued) The request was rejected because an invalid or out-of-range // value was supplied for an input parameter. type InvalidInputException struct { Message *string ErrorCodeOverride *string ErrorCode_ *string FieldName *string noSmithyDocumentSerde } func (e *InvalidInputException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidInputException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidInputException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidInputException" } return *e.ErrorCodeOverride } func (e *InvalidInputException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // (Discontinued) The request was rejected because it attempted to create // resources beyond the current Amazon Web Services account quotas. The error code // describes the quota exceeded. type LimitExceededException struct { Message *string ErrorCodeOverride *string ErrorCode_ *string ResourceType *string noSmithyDocumentSerde } func (e *LimitExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *LimitExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *LimitExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "LimitExceededException" } return *e.ErrorCodeOverride } func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( smithydocument "github.com/aws/smithy-go/document" ) // (Discontinued) The classification type that Amazon Macie Classic applies to the // associated S3 resources. type ClassificationType struct { // (Discontinued) A continuous classification of the objects that are added to a // specified S3 bucket. Amazon Macie Classic begins performing continuous // classification after a bucket is successfully associated with Macie Classic. // // This member is required. Continuous S3ContinuousClassificationType // (Discontinued) A one-time classification of all of the existing objects in a // specified S3 bucket. // // This member is required. OneTime S3OneTimeClassificationType noSmithyDocumentSerde } // (Discontinued) The classification type that Amazon Macie Classic applies to the // associated S3 resources. At least one of the classification types ( oneTime or // continuous ) must be specified. type ClassificationTypeUpdate struct { // (Discontinued) A continuous classification of the objects that are added to a // specified S3 bucket. Amazon Macie Classic begins performing continuous // classification after a bucket is successfully associated with Macie Classic. Continuous S3ContinuousClassificationType // (Discontinued) A one-time classification of all of the existing objects in a // specified S3 bucket. OneTime S3OneTimeClassificationType noSmithyDocumentSerde } // (Discontinued) Includes details about the failed S3 resources. type FailedS3Resource struct { // (Discontinued) The status code of a failed item. ErrorCode *string // (Discontinued) The error message of a failed item. ErrorMessage *string // (Discontinued) The failed S3 resources. FailedItem *S3Resource noSmithyDocumentSerde } // (Discontinued) Contains information about the Amazon Macie Classic member // account. type MemberAccount struct { // (Discontinued) The Amazon Web Services account ID of the Amazon Macie Classic // member account. AccountId *string noSmithyDocumentSerde } // (Discontinued) Contains information about the S3 resource. This data type is // used as a request parameter in the DisassociateS3Resources action and can be // used as a response parameter in the AssociateS3Resources and UpdateS3Resources // actions. type S3Resource struct { // (Discontinued) The name of the S3 bucket. // // This member is required. BucketName *string // (Discontinued) The prefix of the S3 bucket. Prefix *string noSmithyDocumentSerde } // (Discontinued) The S3 resources that you want to associate with Amazon Macie // Classic for monitoring and data classification. This data type is used as a // request parameter in the AssociateS3Resources action and a response parameter // in the ListS3Resources action. type S3ResourceClassification struct { // (Discontinued) The name of the S3 bucket that you want to associate with Amazon // Macie Classic. // // This member is required. BucketName *string // (Discontinued) The classification type that you want to specify for the // resource associated with Amazon Macie Classic. // // This member is required. ClassificationType *ClassificationType // (Discontinued) The prefix of the S3 bucket that you want to associate with // Amazon Macie Classic. Prefix *string noSmithyDocumentSerde } // (Discontinued) The S3 resources whose classification types you want to update. // This data type is used as a request parameter in the UpdateS3Resources action. type S3ResourceClassificationUpdate struct { // (Discontinued) The name of the S3 bucket whose classification types you want to // update. // // This member is required. BucketName *string // (Discontinued) The classification type that you want to update for the resource // associated with Amazon Macie Classic. // // This member is required. ClassificationTypeUpdate *ClassificationTypeUpdate // (Discontinued) The prefix of the S3 bucket whose classification types you want // to update. Prefix *string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
138
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" cryptorand "crypto/rand" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" smithyrand "github.com/aws/smithy-go/rand" smithyhttp "github.com/aws/smithy-go/transport/http" "net" "net/http" "time" ) const ServiceID = "Macie2" const ServiceAPIVersion = "2020-01-01" // Client provides the API client to make operations call for Amazon Macie 2. type Client struct { options Options } // New returns an initialized Client based on the functional options. Provide // additional functional options to further configure the behavior of the client, // such as changing the client's endpoint or adding custom middleware behavior. func New(options Options, optFns ...func(*Options)) *Client { options = options.Copy() resolveDefaultLogger(&options) setResolvedDefaultsMode(&options) resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) resolveDefaultEndpointConfiguration(&options) resolveIdempotencyTokenProvider(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } return client } type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // Configures the events that will be sent to the configured logger. ClientLogMode aws.ClientLogMode // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The configuration DefaultsMode that the SDK should use when constructing the // clients initial default settings. DefaultsMode aws.DefaultsMode // The endpoint options to be used when attempting to resolve an endpoint. EndpointOptions EndpointResolverOptions // The service endpoint resolver. EndpointResolver EndpointResolver // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 // Provides idempotency tokens values that will be automatically populated into // idempotent API operations. IdempotencyTokenProvider IdempotencyTokenProvider // The logger writer interface to write logging messages to. Logger logging.Logger // The region to send requests to. (Required) Region string // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify // per operation call's retry max attempts. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. If specified in an operation call's functional // options with a value that is different than the constructed client's Options, // the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if // Retryer option is not also specified. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. Currently does not support per operation call // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. The kind of // default retry created by the API client can be changed with the RetryMode // option. Retryer aws.Retryer // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You // should not populate this structure programmatically, or rely on the values here // within your applications. RuntimeEnvironment aws.RuntimeEnvironment // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved // value was at that point in time. Currently does not support per operation call // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient } // WithAPIOptions returns a functional option for setting the Client's APIOptions // option. func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { return func(o *Options) { o.APIOptions = append(o.APIOptions, optFns...) } } // WithEndpointResolver returns a functional option for setting the Client's // EndpointResolver option. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v } } type HTTPClient interface { Do(*http.Request) (*http.Response, error) } // Copy creates a clone where the APIOptions list is deep copied. func (o Options) Copy() Options { to := o to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) copy(to.APIOptions, o.APIOptions) return to } func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err } } for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, metadata, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err = handler.Handle(ctx, params) if err != nil { err = &smithy.OperationError{ ServiceID: ServiceID, OperationName: opID, Err: err, } } return result, metadata, err } type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { if o.Logger != nil { return } o.Logger = logging.Nop{} } func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } func setResolvedDefaultsMode(o *Options) { if len(o.resolvedDefaultsMode) > 0 { return } var mode aws.DefaultsMode mode.SetFromString(string(o.DefaultsMode)) if mode == aws.DefaultsModeAuto { mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) } o.resolvedDefaultsMode = mode } // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, DefaultsMode: cfg.DefaultsMode, RuntimeEnvironment: cfg.RuntimeEnvironment, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { var buildable *awshttp.BuildableClient if o.HTTPClient != nil { var ok bool buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) if !ok { return } } else { buildable = awshttp.NewBuildableClient() } modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { dialer.Timeout = dialerTimeout } }) buildable = buildable.WithTransportOptions(func(transport *http.Transport) { if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { transport.TLSHandshakeTimeout = tlsHandshakeTimeout } }) } o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } if len(o.RetryMode) == 0 { modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { o.RetryMode = modeConfig.RetryMode } } if len(o.RetryMode) == 0 { o.RetryMode = aws.RetryModeStandard } var standardOptions []func(*retry.StandardOptions) if v := o.RetryMaxAttempts; v != 0 { standardOptions = append(standardOptions, func(so *retry.StandardOptions) { so.MaxAttempts = v }) } switch o.RetryMode { case aws.RetryModeAdaptive: var adaptiveOptions []func(*retry.AdaptiveModeOptions) if len(standardOptions) != 0 { adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { ao.StandardOptions = append(ao.StandardOptions, standardOptions...) }) } o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) default: o.Retryer = retry.NewStandard(standardOptions...) } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { if cfg.Retryer == nil { return } o.Retryer = cfg.Retryer() } func resolveAWSRetryMode(cfg aws.Config, o *Options) { if len(cfg.RetryMode) == 0 { return } o.RetryMode = cfg.RetryMode } func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { if cfg.RetryMaxAttempts == 0 { return } o.RetryMaxAttempts = cfg.RetryMaxAttempts } func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } func addClientUserAgent(stack *middleware.Stack) error { return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "macie2", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func resolveIdempotencyTokenProvider(o *Options) { if o.IdempotencyTokenProvider != nil { return } o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } // IdempotencyTokenProvider interface for providing idempotency token type IdempotencyTokenProvider interface { GetIdempotencyToken() (string, error) } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
454
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "io/ioutil" "net/http" "strings" "testing" ) func TestClient_resolveRetryOptions(t *testing.T) { nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { return &http.Response{ StatusCode: 200, Header: http.Header{}, Body: ioutil.NopCloser(strings.NewReader("")), }, nil }) cases := map[string]struct { defaultsMode aws.DefaultsMode retryer aws.Retryer retryMaxAttempts int opRetryMaxAttempts *int retryMode aws.RetryMode expectClientRetryMode aws.RetryMode expectClientMaxAttempts int expectOpMaxAttempts int }{ "defaults": { defaultsMode: aws.DefaultsModeStandard, expectClientRetryMode: aws.RetryModeStandard, expectClientMaxAttempts: 3, expectOpMaxAttempts: 3, }, "custom default retry": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, "custom op max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(2), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 2, }, "custom op no change max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(10), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, "custom op 0 max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(0), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, } for name, c := range cases { t.Run(name, func(t *testing.T) { client := NewFromConfig(aws.Config{ DefaultsMode: c.defaultsMode, Retryer: func() func() aws.Retryer { if c.retryer == nil { return nil } return func() aws.Retryer { return c.retryer } }(), HTTPClient: nopClient, RetryMaxAttempts: c.retryMaxAttempts, RetryMode: c.retryMode, }) if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { t.Errorf("expect %v retry mode, got %v", e, a) } if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { t.Errorf("expect %v max attempts, got %v", e, a) } _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, []func(*Options){ func(o *Options) { if c.opRetryMaxAttempts == nil { return } o.RetryMaxAttempts = *c.opRetryMaxAttempts }, }, func(s *middleware.Stack, o Options) error { s.Initialize.Clear() s.Serialize.Clear() s.Build.Clear() s.Finalize.Clear() s.Deserialize.Clear() if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { t.Errorf("expect %v op max attempts, got %v", e, a) } return nil }) if err != nil { t.Fatalf("expect no operation error, got %v", err) } }) } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Accepts an Amazon Macie membership invitation that was received from a specific // account. func (c *Client) AcceptInvitation(ctx context.Context, params *AcceptInvitationInput, optFns ...func(*Options)) (*AcceptInvitationOutput, error) { if params == nil { params = &AcceptInvitationInput{} } result, metadata, err := c.invokeOperation(ctx, "AcceptInvitation", params, optFns, c.addOperationAcceptInvitationMiddlewares) if err != nil { return nil, err } out := result.(*AcceptInvitationOutput) out.ResultMetadata = metadata return out, nil } type AcceptInvitationInput struct { // The unique identifier for the invitation to accept. // // This member is required. InvitationId *string // The Amazon Web Services account ID for the account that sent the invitation. AdministratorAccountId *string // (Deprecated) The Amazon Web Services account ID for the account that sent the // invitation. This property has been replaced by the administratorAccountId // property and is retained only for backward compatibility. MasterAccount *string noSmithyDocumentSerde } type AcceptInvitationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAcceptInvitationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpAcceptInvitation{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAcceptInvitation{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpAcceptInvitationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAcceptInvitation(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opAcceptInvitation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "AcceptInvitation", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about one or more custom data identifiers. func (c *Client) BatchGetCustomDataIdentifiers(ctx context.Context, params *BatchGetCustomDataIdentifiersInput, optFns ...func(*Options)) (*BatchGetCustomDataIdentifiersOutput, error) { if params == nil { params = &BatchGetCustomDataIdentifiersInput{} } result, metadata, err := c.invokeOperation(ctx, "BatchGetCustomDataIdentifiers", params, optFns, c.addOperationBatchGetCustomDataIdentifiersMiddlewares) if err != nil { return nil, err } out := result.(*BatchGetCustomDataIdentifiersOutput) out.ResultMetadata = metadata return out, nil } type BatchGetCustomDataIdentifiersInput struct { // An array of custom data identifier IDs, one for each custom data identifier to // retrieve information about. Ids []string noSmithyDocumentSerde } type BatchGetCustomDataIdentifiersOutput struct { // An array of objects, one for each custom data identifier that matches the // criteria specified in the request. CustomDataIdentifiers []types.BatchGetCustomDataIdentifierSummary // An array of custom data identifier IDs, one for each custom data identifier // that was specified in the request but doesn't correlate to an existing custom // data identifier. NotFoundIdentifierIds []string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationBatchGetCustomDataIdentifiersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchGetCustomDataIdentifiers{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchGetCustomDataIdentifiers{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetCustomDataIdentifiers(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opBatchGetCustomDataIdentifiers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "BatchGetCustomDataIdentifiers", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates and defines the settings for an allow list. func (c *Client) CreateAllowList(ctx context.Context, params *CreateAllowListInput, optFns ...func(*Options)) (*CreateAllowListOutput, error) { if params == nil { params = &CreateAllowListInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateAllowList", params, optFns, c.addOperationCreateAllowListMiddlewares) if err != nil { return nil, err } out := result.(*CreateAllowListOutput) out.ResultMetadata = metadata return out, nil } type CreateAllowListInput struct { // A unique, case-sensitive token that you provide to ensure the idempotency of // the request. // // This member is required. ClientToken *string // The criteria that specify the text or text pattern to ignore. The criteria can // be the location and name of an S3 object that lists specific text to ignore // (s3WordsList), or a regular expression (regex) that defines a text pattern to // ignore. // // This member is required. Criteria *types.AllowListCriteria // A custom name for the allow list. The name can contain as many as 128 // characters. // // This member is required. Name *string // A custom description of the allow list. The description can contain as many as // 512 characters. Description *string // A map of key-value pairs that specifies the tags to associate with the allow // list. An allow list can have a maximum of 50 tags. Each tag consists of a tag // key and an associated tag value. The maximum length of a tag key is 128 // characters. The maximum length of a tag value is 256 characters. Tags map[string]string noSmithyDocumentSerde } type CreateAllowListOutput struct { // The Amazon Resource Name (ARN) of the allow list. Arn *string // The unique identifier for the allow list. Id *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateAllowListMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAllowList{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAllowList{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addIdempotencyToken_opCreateAllowListMiddleware(stack, options); err != nil { return err } if err = addOpCreateAllowListValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAllowList(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } type idempotencyToken_initializeOpCreateAllowList struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateAllowList) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateAllowList) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*CreateAllowListInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateAllowListInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateAllowListMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateAllowList{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateAllowList(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "CreateAllowList", } }
190
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates and defines the settings for a classification job. func (c *Client) CreateClassificationJob(ctx context.Context, params *CreateClassificationJobInput, optFns ...func(*Options)) (*CreateClassificationJobOutput, error) { if params == nil { params = &CreateClassificationJobInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateClassificationJob", params, optFns, c.addOperationCreateClassificationJobMiddlewares) if err != nil { return nil, err } out := result.(*CreateClassificationJobOutput) out.ResultMetadata = metadata return out, nil } type CreateClassificationJobInput struct { // A unique, case-sensitive token that you provide to ensure the idempotency of // the request. // // This member is required. ClientToken *string // The schedule for running the job. Valid values are: // - ONE_TIME - Run the job only once. If you specify this value, don't specify // a value for the scheduleFrequency property. // - SCHEDULED - Run the job on a daily, weekly, or monthly basis. If you // specify this value, use the scheduleFrequency property to define the recurrence // pattern for the job. // // This member is required. JobType types.JobType // A custom name for the job. The name can contain as many as 500 characters. // // This member is required. Name *string // The S3 buckets that contain the objects to analyze, and the scope of that // analysis. // // This member is required. S3JobDefinition *types.S3JobDefinition // An array of unique identifiers, one for each allow list for the job to use when // it analyzes data. AllowListIds []string // An array of unique identifiers, one for each custom data identifier for the job // to use when it analyzes data. To use only managed data identifiers, don't // specify a value for this property and specify a value other than NONE for the // managedDataIdentifierSelector property. CustomDataIdentifierIds []string // A custom description of the job. The description can contain as many as 200 // characters. Description *string // For a recurring job, specifies whether to analyze all existing, eligible // objects immediately after the job is created (true). To analyze only those // objects that are created or changed after you create the job and before the // job's first scheduled run, set this value to false. If you configure the job to // run only once, don't specify a value for this property. InitialRun bool // An array of unique identifiers, one for each managed data identifier for the // job to include (use) or exclude (not use) when it analyzes data. Inclusion or // exclusion depends on the managed data identifier selection type that you specify // for the job (managedDataIdentifierSelector). To retrieve a list of valid values // for this property, use the ListManagedDataIdentifiers operation. ManagedDataIdentifierIds []string // The selection type to apply when determining which managed data identifiers the // job uses to analyze data. Valid values are: // - ALL (default) - Use all managed data identifiers. If you specify this // value, don't specify any values for the managedDataIdentifierIds property. // - EXCLUDE - Use all managed data identifiers except the ones specified by the // managedDataIdentifierIds property. // - INCLUDE - Use only the managed data identifiers specified by the // managedDataIdentifierIds property. // - NONE - Don't use any managed data identifiers. If you specify this value, // specify at least one custom data identifier for the job // (customDataIdentifierIds) and don't specify any values for the // managedDataIdentifierIds property. // - RECOMMENDED - Use only the set of managed data identifiers that Amazon Web // Services recommends for jobs. If you specify this value, don't specify any // values for the managedDataIdentifierIds property. // If you don't specify a value for this property, the job uses all managed data // identifiers. If the job is a recurring job and you don't specify a value for // this property or you specify ALL or EXCLUDE, each job run automatically uses new // managed data identifiers that are released. If you specify RECOMMENDED for a // recurring job, each job run automatically uses all the managed data identifiers // that are in the recommended set when the job starts to run. For information // about individual managed data identifiers or to determine which ones are in the // recommended set, see Using managed data identifiers (https://docs.aws.amazon.com/macie/latest/user/managed-data-identifiers.html) // and Recommended managed data identifiers (https://docs.aws.amazon.com/macie/latest/user/discovery-jobs-mdis-recommended.html) // in the Amazon Macie User Guide. ManagedDataIdentifierSelector types.ManagedDataIdentifierSelector // The sampling depth, as a percentage, for the job to apply when processing // objects. This value determines the percentage of eligible objects that the job // analyzes. If this value is less than 100, Amazon Macie selects the objects to // analyze at random, up to the specified percentage, and analyzes all the data in // those objects. SamplingPercentage int32 // The recurrence pattern for running the job. To run the job only once, don't // specify a value for this property and set the value for the jobType property to // ONE_TIME. ScheduleFrequency *types.JobScheduleFrequency // A map of key-value pairs that specifies the tags to associate with the job. A // job can have a maximum of 50 tags. Each tag consists of a tag key and an // associated tag value. The maximum length of a tag key is 128 characters. The // maximum length of a tag value is 256 characters. Tags map[string]string noSmithyDocumentSerde } type CreateClassificationJobOutput struct { // The Amazon Resource Name (ARN) of the job. JobArn *string // The unique identifier for the job. JobId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateClassificationJobMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateClassificationJob{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateClassificationJob{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addIdempotencyToken_opCreateClassificationJobMiddleware(stack, options); err != nil { return err } if err = addOpCreateClassificationJobValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateClassificationJob(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } type idempotencyToken_initializeOpCreateClassificationJob struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateClassificationJob) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateClassificationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*CreateClassificationJobInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateClassificationJobInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateClassificationJobMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateClassificationJob{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateClassificationJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "CreateClassificationJob", } }
260
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates and defines the criteria and other settings for a custom data // identifier. func (c *Client) CreateCustomDataIdentifier(ctx context.Context, params *CreateCustomDataIdentifierInput, optFns ...func(*Options)) (*CreateCustomDataIdentifierOutput, error) { if params == nil { params = &CreateCustomDataIdentifierInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateCustomDataIdentifier", params, optFns, c.addOperationCreateCustomDataIdentifierMiddlewares) if err != nil { return nil, err } out := result.(*CreateCustomDataIdentifierOutput) out.ResultMetadata = metadata return out, nil } type CreateCustomDataIdentifierInput struct { // A custom name for the custom data identifier. The name can contain as many as // 128 characters. We strongly recommend that you avoid including any sensitive // data in the name of a custom data identifier. Other users of your account might // be able to see this name, depending on the actions that they're allowed to // perform in Amazon Macie. // // This member is required. Name *string // The regular expression (regex) that defines the pattern to match. The // expression can contain as many as 512 characters. // // This member is required. Regex *string // A unique, case-sensitive token that you provide to ensure the idempotency of // the request. ClientToken *string // A custom description of the custom data identifier. The description can contain // as many as 512 characters. We strongly recommend that you avoid including any // sensitive data in the description of a custom data identifier. Other users of // your account might be able to see this description, depending on the actions // that they're allowed to perform in Amazon Macie. Description *string // An array that lists specific character sequences (ignore words) to exclude from // the results. If the text matched by the regular expression contains any string // in this array, Amazon Macie ignores it. The array can contain as many as 10 // ignore words. Each ignore word can contain 4-90 UTF-8 characters. Ignore words // are case sensitive. IgnoreWords []string // An array that lists specific character sequences (keywords), one of which must // precede and be within proximity (maximumMatchDistance) of the regular expression // to match. The array can contain as many as 50 keywords. Each keyword can contain // 3-90 UTF-8 characters. Keywords aren't case sensitive. Keywords []string // The maximum number of characters that can exist between the end of at least one // complete character sequence specified by the keywords array and the end of the // text that matches the regex pattern. If a complete keyword precedes all the text // that matches the pattern and the keyword is within the specified distance, // Amazon Macie includes the result. The distance can be 1-300 characters. The // default value is 50. MaximumMatchDistance int32 // The severity to assign to findings that the custom data identifier produces, // based on the number of occurrences of text that match the custom data // identifier's detection criteria. You can specify as many as three SeverityLevel // objects in this array, one for each severity: LOW, MEDIUM, or HIGH. If you // specify more than one, the occurrences thresholds must be in ascending order by // severity, moving from LOW to HIGH. For example, 1 for LOW, 50 for MEDIUM, and // 100 for HIGH. If an S3 object contains fewer occurrences than the lowest // specified threshold, Amazon Macie doesn't create a finding. If you don't specify // any values for this array, Macie creates findings for S3 objects that contain at // least one occurrence of text that matches the detection criteria, and Macie // assigns the MEDIUM severity to those findings. SeverityLevels []types.SeverityLevel // A map of key-value pairs that specifies the tags to associate with the custom // data identifier. A custom data identifier can have a maximum of 50 tags. Each // tag consists of a tag key and an associated tag value. The maximum length of a // tag key is 128 characters. The maximum length of a tag value is 256 characters. Tags map[string]string noSmithyDocumentSerde } type CreateCustomDataIdentifierOutput struct { // The unique identifier for the custom data identifier that was created. CustomDataIdentifierId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateCustomDataIdentifierMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateCustomDataIdentifier{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateCustomDataIdentifier{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addIdempotencyToken_opCreateCustomDataIdentifierMiddleware(stack, options); err != nil { return err } if err = addOpCreateCustomDataIdentifierValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCustomDataIdentifier(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } type idempotencyToken_initializeOpCreateCustomDataIdentifier struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateCustomDataIdentifier) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateCustomDataIdentifier) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*CreateCustomDataIdentifierInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateCustomDataIdentifierInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateCustomDataIdentifierMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateCustomDataIdentifier{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateCustomDataIdentifier(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "CreateCustomDataIdentifier", } }
224
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates and defines the criteria and other settings for a findings filter. func (c *Client) CreateFindingsFilter(ctx context.Context, params *CreateFindingsFilterInput, optFns ...func(*Options)) (*CreateFindingsFilterOutput, error) { if params == nil { params = &CreateFindingsFilterInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateFindingsFilter", params, optFns, c.addOperationCreateFindingsFilterMiddlewares) if err != nil { return nil, err } out := result.(*CreateFindingsFilterOutput) out.ResultMetadata = metadata return out, nil } type CreateFindingsFilterInput struct { // The action to perform on findings that match the filter criteria // (findingCriteria). Valid values are: ARCHIVE, suppress (automatically archive) // the findings; and, NOOP, don't perform any action on the findings. // // This member is required. Action types.FindingsFilterAction // The criteria to use to filter findings. // // This member is required. FindingCriteria *types.FindingCriteria // A custom name for the filter. The name must contain at least 3 characters and // can contain as many as 64 characters. We strongly recommend that you avoid // including any sensitive data in the name of a filter. Other users of your // account might be able to see this name, depending on the actions that they're // allowed to perform in Amazon Macie. // // This member is required. Name *string // A unique, case-sensitive token that you provide to ensure the idempotency of // the request. ClientToken *string // A custom description of the filter. The description can contain as many as 512 // characters. We strongly recommend that you avoid including any sensitive data in // the description of a filter. Other users of your account might be able to see // this description, depending on the actions that they're allowed to perform in // Amazon Macie. Description *string // The position of the filter in the list of saved filters on the Amazon Macie // console. This value also determines the order in which the filter is applied to // findings, relative to other filters that are also applied to the findings. Position int32 // A map of key-value pairs that specifies the tags to associate with the filter. // A findings filter can have a maximum of 50 tags. Each tag consists of a tag key // and an associated tag value. The maximum length of a tag key is 128 characters. // The maximum length of a tag value is 256 characters. Tags map[string]string noSmithyDocumentSerde } type CreateFindingsFilterOutput struct { // The Amazon Resource Name (ARN) of the filter that was created. Arn *string // The unique identifier for the filter that was created. Id *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateFindingsFilterMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateFindingsFilter{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateFindingsFilter{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addIdempotencyToken_opCreateFindingsFilterMiddleware(stack, options); err != nil { return err } if err = addOpCreateFindingsFilterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFindingsFilter(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } type idempotencyToken_initializeOpCreateFindingsFilter struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateFindingsFilter) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateFindingsFilter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*CreateFindingsFilterInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateFindingsFilterInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateFindingsFilterMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateFindingsFilter{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateFindingsFilter(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "CreateFindingsFilter", } }
203
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Sends an Amazon Macie membership invitation to one or more accounts. func (c *Client) CreateInvitations(ctx context.Context, params *CreateInvitationsInput, optFns ...func(*Options)) (*CreateInvitationsOutput, error) { if params == nil { params = &CreateInvitationsInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateInvitations", params, optFns, c.addOperationCreateInvitationsMiddlewares) if err != nil { return nil, err } out := result.(*CreateInvitationsOutput) out.ResultMetadata = metadata return out, nil } type CreateInvitationsInput struct { // An array that lists Amazon Web Services account IDs, one for each account to // send the invitation to. // // This member is required. AccountIds []string // Specifies whether to send the invitation as an email message. If this value is // false, Amazon Macie sends the invitation (as an email message) to the email // address that you specified for the recipient's account when you associated the // account with your account. The default value is false. DisableEmailNotification bool // Custom text to include in the email message that contains the invitation. The // text can contain as many as 80 alphanumeric characters. Message *string noSmithyDocumentSerde } type CreateInvitationsOutput struct { // An array of objects, one for each account whose invitation hasn't been // processed. Each object identifies the account and explains why the invitation // hasn't been processed for the account. UnprocessedAccounts []types.UnprocessedAccount // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateInvitationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateInvitations{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateInvitations{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateInvitationsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateInvitations(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opCreateInvitations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "CreateInvitations", } }
138
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Associates an account with an Amazon Macie administrator account. func (c *Client) CreateMember(ctx context.Context, params *CreateMemberInput, optFns ...func(*Options)) (*CreateMemberOutput, error) { if params == nil { params = &CreateMemberInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateMember", params, optFns, c.addOperationCreateMemberMiddlewares) if err != nil { return nil, err } out := result.(*CreateMemberOutput) out.ResultMetadata = metadata return out, nil } type CreateMemberInput struct { // The details of the account to associate with the administrator account. // // This member is required. Account *types.AccountDetail // A map of key-value pairs that specifies the tags to associate with the account // in Amazon Macie. An account can have a maximum of 50 tags. Each tag consists of // a tag key and an associated tag value. The maximum length of a tag key is 128 // characters. The maximum length of a tag value is 256 characters. Tags map[string]string noSmithyDocumentSerde } type CreateMemberOutput struct { // The Amazon Resource Name (ARN) of the account that was associated with the // administrator account. Arn *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateMemberMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateMember{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateMember{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateMemberValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateMember(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opCreateMember(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "CreateMember", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates sample findings. func (c *Client) CreateSampleFindings(ctx context.Context, params *CreateSampleFindingsInput, optFns ...func(*Options)) (*CreateSampleFindingsOutput, error) { if params == nil { params = &CreateSampleFindingsInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateSampleFindings", params, optFns, c.addOperationCreateSampleFindingsMiddlewares) if err != nil { return nil, err } out := result.(*CreateSampleFindingsOutput) out.ResultMetadata = metadata return out, nil } type CreateSampleFindingsInput struct { // An array of finding types, one for each type of sample finding to create. To // create a sample of every type of finding that Amazon Macie supports, don't // include this array in your request. FindingTypes []types.FindingType noSmithyDocumentSerde } type CreateSampleFindingsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateSampleFindingsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSampleFindings{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSampleFindings{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSampleFindings(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opCreateSampleFindings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "CreateSampleFindings", } }
118
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Declines Amazon Macie membership invitations that were received from specific // accounts. func (c *Client) DeclineInvitations(ctx context.Context, params *DeclineInvitationsInput, optFns ...func(*Options)) (*DeclineInvitationsOutput, error) { if params == nil { params = &DeclineInvitationsInput{} } result, metadata, err := c.invokeOperation(ctx, "DeclineInvitations", params, optFns, c.addOperationDeclineInvitationsMiddlewares) if err != nil { return nil, err } out := result.(*DeclineInvitationsOutput) out.ResultMetadata = metadata return out, nil } type DeclineInvitationsInput struct { // An array that lists Amazon Web Services account IDs, one for each account that // sent an invitation to decline. // // This member is required. AccountIds []string noSmithyDocumentSerde } type DeclineInvitationsOutput struct { // An array of objects, one for each account whose invitation hasn't been // declined. Each object identifies the account and explains why the request hasn't // been processed for that account. UnprocessedAccounts []types.UnprocessedAccount // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeclineInvitationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeclineInvitations{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeclineInvitations{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeclineInvitationsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeclineInvitations(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opDeclineInvitations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "DeclineInvitations", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes an allow list. func (c *Client) DeleteAllowList(ctx context.Context, params *DeleteAllowListInput, optFns ...func(*Options)) (*DeleteAllowListOutput, error) { if params == nil { params = &DeleteAllowListInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteAllowList", params, optFns, c.addOperationDeleteAllowListMiddlewares) if err != nil { return nil, err } out := result.(*DeleteAllowListOutput) out.ResultMetadata = metadata return out, nil } type DeleteAllowListInput struct { // The unique identifier for the Amazon Macie resource that the request applies to. // // This member is required. Id *string // Specifies whether to force deletion of the allow list, even if active // classification jobs are configured to use the list. When you try to delete an // allow list, Amazon Macie checks for classification jobs that use the list and // have a status other than COMPLETE or CANCELLED. By default, Macie rejects your // request if any jobs meet these criteria. To skip these checks and delete the // list, set this value to true. To delete the list only if no active jobs are // configured to use it, set this value to false. IgnoreJobChecks *string noSmithyDocumentSerde } type DeleteAllowListOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteAllowListMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAllowList{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAllowList{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteAllowListValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAllowList(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opDeleteAllowList(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "DeleteAllowList", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Soft deletes a custom data identifier. func (c *Client) DeleteCustomDataIdentifier(ctx context.Context, params *DeleteCustomDataIdentifierInput, optFns ...func(*Options)) (*DeleteCustomDataIdentifierOutput, error) { if params == nil { params = &DeleteCustomDataIdentifierInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteCustomDataIdentifier", params, optFns, c.addOperationDeleteCustomDataIdentifierMiddlewares) if err != nil { return nil, err } out := result.(*DeleteCustomDataIdentifierOutput) out.ResultMetadata = metadata return out, nil } type DeleteCustomDataIdentifierInput struct { // The unique identifier for the Amazon Macie resource that the request applies to. // // This member is required. Id *string noSmithyDocumentSerde } type DeleteCustomDataIdentifierOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteCustomDataIdentifierMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCustomDataIdentifier{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCustomDataIdentifier{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteCustomDataIdentifierValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCustomDataIdentifier(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opDeleteCustomDataIdentifier(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "DeleteCustomDataIdentifier", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a findings filter. func (c *Client) DeleteFindingsFilter(ctx context.Context, params *DeleteFindingsFilterInput, optFns ...func(*Options)) (*DeleteFindingsFilterOutput, error) { if params == nil { params = &DeleteFindingsFilterInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteFindingsFilter", params, optFns, c.addOperationDeleteFindingsFilterMiddlewares) if err != nil { return nil, err } out := result.(*DeleteFindingsFilterOutput) out.ResultMetadata = metadata return out, nil } type DeleteFindingsFilterInput struct { // The unique identifier for the Amazon Macie resource that the request applies to. // // This member is required. Id *string noSmithyDocumentSerde } type DeleteFindingsFilterOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteFindingsFilterMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteFindingsFilter{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteFindingsFilter{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteFindingsFilterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteFindingsFilter(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opDeleteFindingsFilter(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "DeleteFindingsFilter", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes Amazon Macie membership invitations that were received from specific // accounts. func (c *Client) DeleteInvitations(ctx context.Context, params *DeleteInvitationsInput, optFns ...func(*Options)) (*DeleteInvitationsOutput, error) { if params == nil { params = &DeleteInvitationsInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteInvitations", params, optFns, c.addOperationDeleteInvitationsMiddlewares) if err != nil { return nil, err } out := result.(*DeleteInvitationsOutput) out.ResultMetadata = metadata return out, nil } type DeleteInvitationsInput struct { // An array that lists Amazon Web Services account IDs, one for each account that // sent an invitation to delete. // // This member is required. AccountIds []string noSmithyDocumentSerde } type DeleteInvitationsOutput struct { // An array of objects, one for each account whose invitation hasn't been deleted. // Each object identifies the account and explains why the request hasn't been // processed for that account. UnprocessedAccounts []types.UnprocessedAccount // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteInvitationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteInvitations{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteInvitations{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteInvitationsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteInvitations(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opDeleteInvitations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "DeleteInvitations", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes the association between an Amazon Macie administrator account and an // account. func (c *Client) DeleteMember(ctx context.Context, params *DeleteMemberInput, optFns ...func(*Options)) (*DeleteMemberOutput, error) { if params == nil { params = &DeleteMemberInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteMember", params, optFns, c.addOperationDeleteMemberMiddlewares) if err != nil { return nil, err } out := result.(*DeleteMemberOutput) out.ResultMetadata = metadata return out, nil } type DeleteMemberInput struct { // The unique identifier for the Amazon Macie resource that the request applies to. // // This member is required. Id *string noSmithyDocumentSerde } type DeleteMemberOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteMemberMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteMember{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteMember{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteMemberValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteMember(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opDeleteMember(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "DeleteMember", } }
121
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves (queries) statistical data and other information about one or more S3 // buckets that Amazon Macie monitors and analyzes for an account. func (c *Client) DescribeBuckets(ctx context.Context, params *DescribeBucketsInput, optFns ...func(*Options)) (*DescribeBucketsOutput, error) { if params == nil { params = &DescribeBucketsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeBuckets", params, optFns, c.addOperationDescribeBucketsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeBucketsOutput) out.ResultMetadata = metadata return out, nil } type DescribeBucketsInput struct { // The criteria to use to filter the query results. Criteria map[string]types.BucketCriteriaAdditionalProperties // The maximum number of items to include in each page of the response. The // default value is 50. MaxResults int32 // The nextToken string that specifies which page of results to return in a // paginated response. NextToken *string // The criteria to use to sort the query results. SortCriteria *types.BucketSortCriteria noSmithyDocumentSerde } type DescribeBucketsOutput struct { // An array of objects, one for each bucket that matches the filter criteria // specified in the request. Buckets []types.BucketMetadata // The string to use in a subsequent request to get the next page of results in a // paginated response. This value is null if there are no additional pages. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeBucketsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeBuckets{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeBuckets{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeBuckets(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // DescribeBucketsAPIClient is a client that implements the DescribeBuckets // operation. type DescribeBucketsAPIClient interface { DescribeBuckets(context.Context, *DescribeBucketsInput, ...func(*Options)) (*DescribeBucketsOutput, error) } var _ DescribeBucketsAPIClient = (*Client)(nil) // DescribeBucketsPaginatorOptions is the paginator options for DescribeBuckets type DescribeBucketsPaginatorOptions struct { // The maximum number of items to include in each page of the response. The // default value is 50. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // DescribeBucketsPaginator is a paginator for DescribeBuckets type DescribeBucketsPaginator struct { options DescribeBucketsPaginatorOptions client DescribeBucketsAPIClient params *DescribeBucketsInput nextToken *string firstPage bool } // NewDescribeBucketsPaginator returns a new DescribeBucketsPaginator func NewDescribeBucketsPaginator(client DescribeBucketsAPIClient, params *DescribeBucketsInput, optFns ...func(*DescribeBucketsPaginatorOptions)) *DescribeBucketsPaginator { if params == nil { params = &DescribeBucketsInput{} } options := DescribeBucketsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeBucketsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeBucketsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeBuckets page. func (p *DescribeBucketsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBucketsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.DescribeBuckets(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeBuckets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "DescribeBuckets", } }
225
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Retrieves the status and settings for a classification job. func (c *Client) DescribeClassificationJob(ctx context.Context, params *DescribeClassificationJobInput, optFns ...func(*Options)) (*DescribeClassificationJobOutput, error) { if params == nil { params = &DescribeClassificationJobInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeClassificationJob", params, optFns, c.addOperationDescribeClassificationJobMiddlewares) if err != nil { return nil, err } out := result.(*DescribeClassificationJobOutput) out.ResultMetadata = metadata return out, nil } type DescribeClassificationJobInput struct { // The unique identifier for the classification job. // // This member is required. JobId *string noSmithyDocumentSerde } type DescribeClassificationJobOutput struct { // An array of unique identifiers, one for each allow list that the job uses when // it analyzes data. AllowListIds []string // The token that was provided to ensure the idempotency of the request to create // the job. ClientToken *string // The date and time, in UTC and extended ISO 8601 format, when the job was // created. CreatedAt *time.Time // An array of unique identifiers, one for each custom data identifier that the // job uses when it analyzes data. This value is null if the job uses only managed // data identifiers to analyze data. CustomDataIdentifierIds []string // The custom description of the job. Description *string // For a recurring job, specifies whether you configured the job to analyze all // existing, eligible objects immediately after the job was created (true). If you // configured the job to analyze only those objects that were created or changed // after the job was created and before the job's first scheduled run, this value // is false. This value is also false for a one-time job. InitialRun bool // The Amazon Resource Name (ARN) of the job. JobArn *string // The unique identifier for the job. JobId *string // The current status of the job. Possible values are: // - CANCELLED - You cancelled the job or, if it's a one-time job, you paused // the job and didn't resume it within 30 days. // - COMPLETE - For a one-time job, Amazon Macie finished processing the data // specified for the job. This value doesn't apply to recurring jobs. // - IDLE - For a recurring job, the previous scheduled run is complete and the // next scheduled run is pending. This value doesn't apply to one-time jobs. // - PAUSED - Macie started running the job but additional processing would // exceed the monthly sensitive data discovery quota for your account or one or // more member accounts that the job analyzes data for. // - RUNNING - For a one-time job, the job is in progress. For a recurring job, // a scheduled run is in progress. // - USER_PAUSED - You paused the job. If you paused the job while it had a // status of RUNNING and you don't resume it within 30 days of pausing it, the job // or job run will expire and be cancelled, depending on the job's type. To check // the expiration date, refer to the UserPausedDetails.jobExpiresAt property. JobStatus types.JobStatus // The schedule for running the job. Possible values are: // - ONE_TIME - The job runs only once. // - SCHEDULED - The job runs on a daily, weekly, or monthly basis. The // scheduleFrequency property indicates the recurrence pattern for the job. JobType types.JobType // Specifies whether any account- or bucket-level access errors occurred when the // job ran. For a recurring job, this value indicates the error status of the job's // most recent run. LastRunErrorStatus *types.LastRunErrorStatus // The date and time, in UTC and extended ISO 8601 format, when the job started. // If the job is a recurring job, this value indicates when the most recent run // started or, if the job hasn't run yet, when the job was created. LastRunTime *time.Time // An array of unique identifiers, one for each managed data identifier that the // job is explicitly configured to include (use) or exclude (not use) when it // analyzes data. Inclusion or exclusion depends on the managed data identifier // selection type specified for the job (managedDataIdentifierSelector).This value // is null if the job's managed data identifier selection type is ALL, NONE, or // RECOMMENDED. ManagedDataIdentifierIds []string // The selection type that determines which managed data identifiers the job uses // when it analyzes data. Possible values are: // - ALL (default) - Use all managed data identifiers. // - EXCLUDE - Use all managed data identifiers except the ones specified by the // managedDataIdentifierIds property. // - INCLUDE - Use only the managed data identifiers specified by the // managedDataIdentifierIds property. // - NONE - Don't use any managed data identifiers. Use only custom data // identifiers (customDataIdentifierIds). // - RECOMMENDED - Use only the set of managed data identifiers that Amazon Web // Services recommends for jobs. // If this value is null, the job uses all managed data identifiers. If the job is // a recurring job and this value is null, ALL, or EXCLUDE, each job run // automatically uses new managed data identifiers that are released after the job // was created or the preceding run ended. If this value is RECOMMENDED for a // recurring job, each job run uses all the managed data identifiers that are in // the recommended set when the run starts. For information about individual // managed data identifiers or to determine which ones are in the recommended set, // see Using managed data identifiers (https://docs.aws.amazon.com/macie/latest/user/managed-data-identifiers.html) // and Recommended managed data identifiers (https://docs.aws.amazon.com/macie/latest/user/discovery-jobs-mdis-recommended.html) // in the Amazon Macie User Guide. ManagedDataIdentifierSelector types.ManagedDataIdentifierSelector // The custom name of the job. Name *string // The S3 buckets that contain the objects to analyze, and the scope of that // analysis. S3JobDefinition *types.S3JobDefinition // The sampling depth, as a percentage, that determines the percentage of eligible // objects that the job analyzes. SamplingPercentage int32 // The recurrence pattern for running the job. This value is null if the job is // configured to run only once. ScheduleFrequency *types.JobScheduleFrequency // The number of times that the job has run and processing statistics for the // job's current run. Statistics *types.Statistics // A map of key-value pairs that specifies which tags (keys and values) are // associated with the classification job. Tags map[string]string // If the current status of the job is USER_PAUSED, specifies when the job was // paused and when the job or job run will expire and be cancelled if it isn't // resumed. This value is present only if the value for jobStatus is USER_PAUSED. UserPausedDetails *types.UserPausedDetails // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeClassificationJobMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeClassificationJob{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeClassificationJob{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeClassificationJobValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeClassificationJob(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opDescribeClassificationJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "DescribeClassificationJob", } }
249
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves the Amazon Macie configuration settings for an organization in // Organizations. func (c *Client) DescribeOrganizationConfiguration(ctx context.Context, params *DescribeOrganizationConfigurationInput, optFns ...func(*Options)) (*DescribeOrganizationConfigurationOutput, error) { if params == nil { params = &DescribeOrganizationConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeOrganizationConfiguration", params, optFns, c.addOperationDescribeOrganizationConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*DescribeOrganizationConfigurationOutput) out.ResultMetadata = metadata return out, nil } type DescribeOrganizationConfigurationInput struct { noSmithyDocumentSerde } type DescribeOrganizationConfigurationOutput struct { // Specifies whether Amazon Macie is enabled automatically for accounts that are // added to the organization. AutoEnable bool // Specifies whether the maximum number of Amazon Macie member accounts are part // of the organization. MaxAccountLimitReached bool // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeOrganizationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeOrganizationConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeOrganizationConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeOrganizationConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opDescribeOrganizationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "DescribeOrganizationConfiguration", } }
121
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Disables Amazon Macie and deletes all settings and resources for a Macie // account. func (c *Client) DisableMacie(ctx context.Context, params *DisableMacieInput, optFns ...func(*Options)) (*DisableMacieOutput, error) { if params == nil { params = &DisableMacieInput{} } result, metadata, err := c.invokeOperation(ctx, "DisableMacie", params, optFns, c.addOperationDisableMacieMiddlewares) if err != nil { return nil, err } out := result.(*DisableMacieOutput) out.ResultMetadata = metadata return out, nil } type DisableMacieInput struct { noSmithyDocumentSerde } type DisableMacieOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDisableMacieMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDisableMacie{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisableMacie{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableMacie(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opDisableMacie(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "DisableMacie", } }
112
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Disables an account as the delegated Amazon Macie administrator account for an // organization in Organizations. func (c *Client) DisableOrganizationAdminAccount(ctx context.Context, params *DisableOrganizationAdminAccountInput, optFns ...func(*Options)) (*DisableOrganizationAdminAccountOutput, error) { if params == nil { params = &DisableOrganizationAdminAccountInput{} } result, metadata, err := c.invokeOperation(ctx, "DisableOrganizationAdminAccount", params, optFns, c.addOperationDisableOrganizationAdminAccountMiddlewares) if err != nil { return nil, err } out := result.(*DisableOrganizationAdminAccountOutput) out.ResultMetadata = metadata return out, nil } type DisableOrganizationAdminAccountInput struct { // The Amazon Web Services account ID of the delegated Amazon Macie administrator // account. // // This member is required. AdminAccountId *string noSmithyDocumentSerde } type DisableOrganizationAdminAccountOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDisableOrganizationAdminAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDisableOrganizationAdminAccount{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisableOrganizationAdminAccount{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDisableOrganizationAdminAccountValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableOrganizationAdminAccount(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opDisableOrganizationAdminAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "DisableOrganizationAdminAccount", } }
122
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Disassociates a member account from its Amazon Macie administrator account. func (c *Client) DisassociateFromAdministratorAccount(ctx context.Context, params *DisassociateFromAdministratorAccountInput, optFns ...func(*Options)) (*DisassociateFromAdministratorAccountOutput, error) { if params == nil { params = &DisassociateFromAdministratorAccountInput{} } result, metadata, err := c.invokeOperation(ctx, "DisassociateFromAdministratorAccount", params, optFns, c.addOperationDisassociateFromAdministratorAccountMiddlewares) if err != nil { return nil, err } out := result.(*DisassociateFromAdministratorAccountOutput) out.ResultMetadata = metadata return out, nil } type DisassociateFromAdministratorAccountInput struct { noSmithyDocumentSerde } type DisassociateFromAdministratorAccountOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDisassociateFromAdministratorAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateFromAdministratorAccount{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateFromAdministratorAccount{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateFromAdministratorAccount(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opDisassociateFromAdministratorAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "DisassociateFromAdministratorAccount", } }
111
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // (Deprecated) Disassociates a member account from its Amazon Macie administrator // account. This operation has been replaced by the // DisassociateFromAdministratorAccount operation. func (c *Client) DisassociateFromMasterAccount(ctx context.Context, params *DisassociateFromMasterAccountInput, optFns ...func(*Options)) (*DisassociateFromMasterAccountOutput, error) { if params == nil { params = &DisassociateFromMasterAccountInput{} } result, metadata, err := c.invokeOperation(ctx, "DisassociateFromMasterAccount", params, optFns, c.addOperationDisassociateFromMasterAccountMiddlewares) if err != nil { return nil, err } out := result.(*DisassociateFromMasterAccountOutput) out.ResultMetadata = metadata return out, nil } type DisassociateFromMasterAccountInput struct { noSmithyDocumentSerde } type DisassociateFromMasterAccountOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDisassociateFromMasterAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateFromMasterAccount{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateFromMasterAccount{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateFromMasterAccount(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opDisassociateFromMasterAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "DisassociateFromMasterAccount", } }
113
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Disassociates an Amazon Macie administrator account from a member account. func (c *Client) DisassociateMember(ctx context.Context, params *DisassociateMemberInput, optFns ...func(*Options)) (*DisassociateMemberOutput, error) { if params == nil { params = &DisassociateMemberInput{} } result, metadata, err := c.invokeOperation(ctx, "DisassociateMember", params, optFns, c.addOperationDisassociateMemberMiddlewares) if err != nil { return nil, err } out := result.(*DisassociateMemberOutput) out.ResultMetadata = metadata return out, nil } type DisassociateMemberInput struct { // The unique identifier for the Amazon Macie resource that the request applies to. // // This member is required. Id *string noSmithyDocumentSerde } type DisassociateMemberOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDisassociateMemberMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateMember{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateMember{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDisassociateMemberValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateMember(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opDisassociateMember(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "DisassociateMember", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Enables Amazon Macie and specifies the configuration settings for a Macie // account. func (c *Client) EnableMacie(ctx context.Context, params *EnableMacieInput, optFns ...func(*Options)) (*EnableMacieOutput, error) { if params == nil { params = &EnableMacieInput{} } result, metadata, err := c.invokeOperation(ctx, "EnableMacie", params, optFns, c.addOperationEnableMacieMiddlewares) if err != nil { return nil, err } out := result.(*EnableMacieOutput) out.ResultMetadata = metadata return out, nil } type EnableMacieInput struct { // A unique, case-sensitive token that you provide to ensure the idempotency of // the request. ClientToken *string // Specifies how often to publish updates to policy findings for the account. This // includes publishing updates to Security Hub and Amazon EventBridge (formerly // Amazon CloudWatch Events). FindingPublishingFrequency types.FindingPublishingFrequency // Specifies the new status for the account. To enable Amazon Macie and start all // Macie activities for the account, set this value to ENABLED. Status types.MacieStatus noSmithyDocumentSerde } type EnableMacieOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationEnableMacieMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpEnableMacie{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpEnableMacie{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addIdempotencyToken_opEnableMacieMiddleware(stack, options); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableMacie(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } type idempotencyToken_initializeOpEnableMacie struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpEnableMacie) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpEnableMacie) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*EnableMacieInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *EnableMacieInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opEnableMacieMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpEnableMacie{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opEnableMacie(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "EnableMacie", } }
164
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Designates an account as the delegated Amazon Macie administrator account for // an organization in Organizations. func (c *Client) EnableOrganizationAdminAccount(ctx context.Context, params *EnableOrganizationAdminAccountInput, optFns ...func(*Options)) (*EnableOrganizationAdminAccountOutput, error) { if params == nil { params = &EnableOrganizationAdminAccountInput{} } result, metadata, err := c.invokeOperation(ctx, "EnableOrganizationAdminAccount", params, optFns, c.addOperationEnableOrganizationAdminAccountMiddlewares) if err != nil { return nil, err } out := result.(*EnableOrganizationAdminAccountOutput) out.ResultMetadata = metadata return out, nil } type EnableOrganizationAdminAccountInput struct { // The Amazon Web Services account ID for the account to designate as the // delegated Amazon Macie administrator account for the organization. // // This member is required. AdminAccountId *string // A unique, case-sensitive token that you provide to ensure the idempotency of // the request. ClientToken *string noSmithyDocumentSerde } type EnableOrganizationAdminAccountOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationEnableOrganizationAdminAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpEnableOrganizationAdminAccount{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpEnableOrganizationAdminAccount{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addIdempotencyToken_opEnableOrganizationAdminAccountMiddleware(stack, options); err != nil { return err } if err = addOpEnableOrganizationAdminAccountValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableOrganizationAdminAccount(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } type idempotencyToken_initializeOpEnableOrganizationAdminAccount struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpEnableOrganizationAdminAccount) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpEnableOrganizationAdminAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*EnableOrganizationAdminAccountInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *EnableOrganizationAdminAccountInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opEnableOrganizationAdminAccountMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpEnableOrganizationAdminAccount{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opEnableOrganizationAdminAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "EnableOrganizationAdminAccount", } }
163
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about the Amazon Macie administrator account for an // account. func (c *Client) GetAdministratorAccount(ctx context.Context, params *GetAdministratorAccountInput, optFns ...func(*Options)) (*GetAdministratorAccountOutput, error) { if params == nil { params = &GetAdministratorAccountInput{} } result, metadata, err := c.invokeOperation(ctx, "GetAdministratorAccount", params, optFns, c.addOperationGetAdministratorAccountMiddlewares) if err != nil { return nil, err } out := result.(*GetAdministratorAccountOutput) out.ResultMetadata = metadata return out, nil } type GetAdministratorAccountInput struct { noSmithyDocumentSerde } type GetAdministratorAccountOutput struct { // The Amazon Web Services account ID for the administrator account. If the // accounts are associated by an Amazon Macie membership invitation, this object // also provides details about the invitation that was sent to establish the // relationship between the accounts. Administrator *types.Invitation // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetAdministratorAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAdministratorAccount{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAdministratorAccount{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAdministratorAccount(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetAdministratorAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetAdministratorAccount", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Retrieves the settings and status of an allow list. func (c *Client) GetAllowList(ctx context.Context, params *GetAllowListInput, optFns ...func(*Options)) (*GetAllowListOutput, error) { if params == nil { params = &GetAllowListInput{} } result, metadata, err := c.invokeOperation(ctx, "GetAllowList", params, optFns, c.addOperationGetAllowListMiddlewares) if err != nil { return nil, err } out := result.(*GetAllowListOutput) out.ResultMetadata = metadata return out, nil } type GetAllowListInput struct { // The unique identifier for the Amazon Macie resource that the request applies to. // // This member is required. Id *string noSmithyDocumentSerde } type GetAllowListOutput struct { // The Amazon Resource Name (ARN) of the allow list. Arn *string // The date and time, in UTC and extended ISO 8601 format, when the allow list was // created in Amazon Macie. CreatedAt *time.Time // The criteria that specify the text or text pattern to ignore. The criteria can // be the location and name of an S3 object that lists specific text to ignore // (s3WordsList), or a regular expression (regex) that defines a text pattern to // ignore. Criteria *types.AllowListCriteria // The custom description of the allow list. Description *string // The unique identifier for the allow list. Id *string // The custom name of the allow list. Name *string // The current status of the allow list, which indicates whether Amazon Macie can // access and use the list's criteria. Status *types.AllowListStatus // A map of key-value pairs that specifies which tags (keys and values) are // associated with the allow list. Tags map[string]string // The date and time, in UTC and extended ISO 8601 format, when the allow list's // settings were most recently changed in Amazon Macie. UpdatedAt *time.Time // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetAllowListMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAllowList{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAllowList{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetAllowListValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAllowList(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetAllowList(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetAllowList", } }
157
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Retrieves the configuration settings and status of automated sensitive data // discovery for an account. func (c *Client) GetAutomatedDiscoveryConfiguration(ctx context.Context, params *GetAutomatedDiscoveryConfigurationInput, optFns ...func(*Options)) (*GetAutomatedDiscoveryConfigurationOutput, error) { if params == nil { params = &GetAutomatedDiscoveryConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "GetAutomatedDiscoveryConfiguration", params, optFns, c.addOperationGetAutomatedDiscoveryConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*GetAutomatedDiscoveryConfigurationOutput) out.ResultMetadata = metadata return out, nil } type GetAutomatedDiscoveryConfigurationInput struct { noSmithyDocumentSerde } type GetAutomatedDiscoveryConfigurationOutput struct { // The unique identifier for the classification scope that's used when performing // automated sensitive data discovery for the account. The classification scope // specifies S3 buckets to exclude from automated sensitive data discovery. ClassificationScopeId *string // The date and time, in UTC and extended ISO 8601 format, when automated // sensitive data discovery was most recently disabled for the account. This value // is null if automated sensitive data discovery wasn't enabled and subsequently // disabled for the account. DisabledAt *time.Time // The date and time, in UTC and extended ISO 8601 format, when automated // sensitive data discovery was initially enabled for the account. This value is // null if automated sensitive data discovery has never been enabled for the // account. FirstEnabledAt *time.Time // The date and time, in UTC and extended ISO 8601 format, when automated // sensitive data discovery was most recently enabled or disabled for the account. LastUpdatedAt *time.Time // The unique identifier for the sensitivity inspection template that's used when // performing automated sensitive data discovery for the account. The template // specifies which allow lists, custom data identifiers, and managed data // identifiers to use when analyzing data. SensitivityInspectionTemplateId *string // The current status of the automated sensitive data discovery configuration for // the account. Possible values are: ENABLED, use the specified settings to perform // automated sensitive data discovery activities for the account; and, DISABLED, // don't perform automated sensitive data discovery activities for the account. Status types.AutomatedDiscoveryStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetAutomatedDiscoveryConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAutomatedDiscoveryConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAutomatedDiscoveryConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAutomatedDiscoveryConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetAutomatedDiscoveryConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetAutomatedDiscoveryConfiguration", } }
148
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Retrieves (queries) aggregated statistical data about all the S3 buckets that // Amazon Macie monitors and analyzes for an account. func (c *Client) GetBucketStatistics(ctx context.Context, params *GetBucketStatisticsInput, optFns ...func(*Options)) (*GetBucketStatisticsOutput, error) { if params == nil { params = &GetBucketStatisticsInput{} } result, metadata, err := c.invokeOperation(ctx, "GetBucketStatistics", params, optFns, c.addOperationGetBucketStatisticsMiddlewares) if err != nil { return nil, err } out := result.(*GetBucketStatisticsOutput) out.ResultMetadata = metadata return out, nil } type GetBucketStatisticsInput struct { // The unique identifier for the Amazon Web Services account. AccountId *string noSmithyDocumentSerde } type GetBucketStatisticsOutput struct { // The total number of buckets. BucketCount int64 // The total number of buckets that are publicly accessible due to a combination // of permissions settings for each bucket. BucketCountByEffectivePermission *types.BucketCountByEffectivePermission // The total number of buckets whose settings do or don't specify default // server-side encryption behavior for objects that are added to the buckets. BucketCountByEncryptionType *types.BucketCountByEncryptionType // The total number of buckets whose bucket policies do or don't require // server-side encryption of objects when objects are added to the buckets. BucketCountByObjectEncryptionRequirement *types.BucketCountPolicyAllowsUnencryptedObjectUploads // The total number of buckets that are or aren't shared with other Amazon Web // Services accounts, Amazon CloudFront origin access identities (OAIs), or // CloudFront origin access controls (OACs). BucketCountBySharedAccessType *types.BucketCountBySharedAccessType // The aggregated sensitive data discovery statistics for the buckets. If // automated sensitive data discovery is currently disabled for your account, the // value for each statistic is 0. BucketStatisticsBySensitivity *types.BucketStatisticsBySensitivity // The total number of objects that Amazon Macie can analyze in the buckets. These // objects use a supported storage class and have a file name extension for a // supported file or storage format. ClassifiableObjectCount int64 // The total storage size, in bytes, of all the objects that Amazon Macie can // analyze in the buckets. These objects use a supported storage class and have a // file name extension for a supported file or storage format. If versioning is // enabled for any of the buckets, this value is based on the size of the latest // version of each applicable object in the buckets. This value doesn't reflect the // storage size of all versions of all applicable objects in the buckets. ClassifiableSizeInBytes int64 // The date and time, in UTC and extended ISO 8601 format, when Amazon Macie most // recently retrieved bucket or object metadata from Amazon S3 for the buckets. LastUpdated *time.Time // The total number of objects in the buckets. ObjectCount int64 // The total storage size, in bytes, of the buckets. If versioning is enabled for // any of the buckets, this value is based on the size of the latest version of // each object in the buckets. This value doesn't reflect the storage size of all // versions of the objects in the buckets. SizeInBytes int64 // The total storage size, in bytes, of the objects that are compressed (.gz, // .gzip, .zip) files in the buckets. If versioning is enabled for any of the // buckets, this value is based on the size of the latest version of each // applicable object in the buckets. This value doesn't reflect the storage size of // all versions of the applicable objects in the buckets. SizeInBytesCompressed int64 // The total number of objects that Amazon Macie can't analyze in the buckets. // These objects don't use a supported storage class or don't have a file name // extension for a supported file or storage format. UnclassifiableObjectCount *types.ObjectLevelStatistics // The total storage size, in bytes, of the objects that Amazon Macie can't // analyze in the buckets. These objects don't use a supported storage class or // don't have a file name extension for a supported file or storage format. UnclassifiableObjectSizeInBytes *types.ObjectLevelStatistics // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetBucketStatisticsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetBucketStatistics{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetBucketStatistics{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetBucketStatistics(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetBucketStatistics(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetBucketStatistics", } }
187
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves the configuration settings for storing data classification results. func (c *Client) GetClassificationExportConfiguration(ctx context.Context, params *GetClassificationExportConfigurationInput, optFns ...func(*Options)) (*GetClassificationExportConfigurationOutput, error) { if params == nil { params = &GetClassificationExportConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "GetClassificationExportConfiguration", params, optFns, c.addOperationGetClassificationExportConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*GetClassificationExportConfigurationOutput) out.ResultMetadata = metadata return out, nil } type GetClassificationExportConfigurationInput struct { noSmithyDocumentSerde } type GetClassificationExportConfigurationOutput struct { // The location where data classification results are stored, and the encryption // settings that are used when storing results in that location. Configuration *types.ClassificationExportConfiguration // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetClassificationExportConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetClassificationExportConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetClassificationExportConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetClassificationExportConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetClassificationExportConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetClassificationExportConfiguration", } }
117
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves the classification scope settings for an account. func (c *Client) GetClassificationScope(ctx context.Context, params *GetClassificationScopeInput, optFns ...func(*Options)) (*GetClassificationScopeOutput, error) { if params == nil { params = &GetClassificationScopeInput{} } result, metadata, err := c.invokeOperation(ctx, "GetClassificationScope", params, optFns, c.addOperationGetClassificationScopeMiddlewares) if err != nil { return nil, err } out := result.(*GetClassificationScopeOutput) out.ResultMetadata = metadata return out, nil } type GetClassificationScopeInput struct { // The unique identifier for the Amazon Macie resource that the request applies to. // // This member is required. Id *string noSmithyDocumentSerde } type GetClassificationScopeOutput struct { // The unique identifier for the classification scope. Id *string // The name of the classification scope: automated-sensitive-data-discovery. Name *string // The S3 buckets that are excluded from automated sensitive data discovery. S3 *types.S3ClassificationScope // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetClassificationScopeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetClassificationScope{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetClassificationScope{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetClassificationScopeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetClassificationScope(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetClassificationScope(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetClassificationScope", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Retrieves the criteria and other settings for a custom data identifier. func (c *Client) GetCustomDataIdentifier(ctx context.Context, params *GetCustomDataIdentifierInput, optFns ...func(*Options)) (*GetCustomDataIdentifierOutput, error) { if params == nil { params = &GetCustomDataIdentifierInput{} } result, metadata, err := c.invokeOperation(ctx, "GetCustomDataIdentifier", params, optFns, c.addOperationGetCustomDataIdentifierMiddlewares) if err != nil { return nil, err } out := result.(*GetCustomDataIdentifierOutput) out.ResultMetadata = metadata return out, nil } type GetCustomDataIdentifierInput struct { // The unique identifier for the Amazon Macie resource that the request applies to. // // This member is required. Id *string noSmithyDocumentSerde } type GetCustomDataIdentifierOutput struct { // The Amazon Resource Name (ARN) of the custom data identifier. Arn *string // The date and time, in UTC and extended ISO 8601 format, when the custom data // identifier was created. CreatedAt *time.Time // Specifies whether the custom data identifier was deleted. If you delete a // custom data identifier, Amazon Macie doesn't delete it permanently. Instead, it // soft deletes the identifier. Deleted bool // The custom description of the custom data identifier. Description *string // The unique identifier for the custom data identifier. Id *string // An array that lists specific character sequences (ignore words) to exclude from // the results. If the text matched by the regular expression contains any string // in this array, Amazon Macie ignores it. Ignore words are case sensitive. IgnoreWords []string // An array that lists specific character sequences (keywords), one of which must // precede and be within proximity (maximumMatchDistance) of the regular expression // to match. Keywords aren't case sensitive. Keywords []string // The maximum number of characters that can exist between the end of at least one // complete character sequence specified by the keywords array and the end of the // text that matches the regex pattern. If a complete keyword precedes all the text // that matches the pattern and the keyword is within the specified distance, // Amazon Macie includes the result. Otherwise, Macie excludes the result. MaximumMatchDistance int32 // The custom name of the custom data identifier. Name *string // The regular expression (regex) that defines the pattern to match. Regex *string // Specifies the severity that's assigned to findings that the custom data // identifier produces, based on the number of occurrences of text that match the // custom data identifier's detection criteria. By default, Amazon Macie creates // findings for S3 objects that contain at least one occurrence of text that // matches the detection criteria, and Macie assigns the MEDIUM severity to those // findings. SeverityLevels []types.SeverityLevel // A map of key-value pairs that identifies the tags (keys and values) that are // associated with the custom data identifier. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetCustomDataIdentifierMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetCustomDataIdentifier{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetCustomDataIdentifier{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetCustomDataIdentifierValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCustomDataIdentifier(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetCustomDataIdentifier(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetCustomDataIdentifier", } }
176
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves the details of one or more findings. func (c *Client) GetFindings(ctx context.Context, params *GetFindingsInput, optFns ...func(*Options)) (*GetFindingsOutput, error) { if params == nil { params = &GetFindingsInput{} } result, metadata, err := c.invokeOperation(ctx, "GetFindings", params, optFns, c.addOperationGetFindingsMiddlewares) if err != nil { return nil, err } out := result.(*GetFindingsOutput) out.ResultMetadata = metadata return out, nil } type GetFindingsInput struct { // An array of strings that lists the unique identifiers for the findings to // retrieve. You can specify as many as 50 unique identifiers in this array. // // This member is required. FindingIds []string // The criteria for sorting the results of the request. SortCriteria *types.SortCriteria noSmithyDocumentSerde } type GetFindingsOutput struct { // An array of objects, one for each finding that matches the criteria specified // in the request. Findings []types.Finding // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetFindingsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetFindings{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetFindings{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetFindingsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFindings(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetFindings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetFindings", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves the criteria and other settings for a findings filter. func (c *Client) GetFindingsFilter(ctx context.Context, params *GetFindingsFilterInput, optFns ...func(*Options)) (*GetFindingsFilterOutput, error) { if params == nil { params = &GetFindingsFilterInput{} } result, metadata, err := c.invokeOperation(ctx, "GetFindingsFilter", params, optFns, c.addOperationGetFindingsFilterMiddlewares) if err != nil { return nil, err } out := result.(*GetFindingsFilterOutput) out.ResultMetadata = metadata return out, nil } type GetFindingsFilterInput struct { // The unique identifier for the Amazon Macie resource that the request applies to. // // This member is required. Id *string noSmithyDocumentSerde } type GetFindingsFilterOutput struct { // The action that's performed on findings that match the filter criteria // (findingCriteria). Possible values are: ARCHIVE, suppress (automatically // archive) the findings; and, NOOP, don't perform any action on the findings. Action types.FindingsFilterAction // The Amazon Resource Name (ARN) of the filter. Arn *string // The custom description of the filter. Description *string // The criteria that's used to filter findings. FindingCriteria *types.FindingCriteria // The unique identifier for the filter. Id *string // The custom name of the filter. Name *string // The position of the filter in the list of saved filters on the Amazon Macie // console. This value also determines the order in which the filter is applied to // findings, relative to other filters that are also applied to the findings. Position int32 // A map of key-value pairs that specifies which tags (keys and values) are // associated with the filter. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetFindingsFilterMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetFindingsFilter{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetFindingsFilter{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetFindingsFilterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFindingsFilter(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetFindingsFilter(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetFindingsFilter", } }
151
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves the configuration settings for publishing findings to Security Hub. func (c *Client) GetFindingsPublicationConfiguration(ctx context.Context, params *GetFindingsPublicationConfigurationInput, optFns ...func(*Options)) (*GetFindingsPublicationConfigurationOutput, error) { if params == nil { params = &GetFindingsPublicationConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "GetFindingsPublicationConfiguration", params, optFns, c.addOperationGetFindingsPublicationConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*GetFindingsPublicationConfigurationOutput) out.ResultMetadata = metadata return out, nil } type GetFindingsPublicationConfigurationInput struct { noSmithyDocumentSerde } type GetFindingsPublicationConfigurationOutput struct { // The configuration settings that determine which findings are published to // Security Hub. SecurityHubConfiguration *types.SecurityHubConfiguration // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetFindingsPublicationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetFindingsPublicationConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetFindingsPublicationConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFindingsPublicationConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetFindingsPublicationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetFindingsPublicationConfiguration", } }
117
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves (queries) aggregated statistical data about findings. func (c *Client) GetFindingStatistics(ctx context.Context, params *GetFindingStatisticsInput, optFns ...func(*Options)) (*GetFindingStatisticsOutput, error) { if params == nil { params = &GetFindingStatisticsInput{} } result, metadata, err := c.invokeOperation(ctx, "GetFindingStatistics", params, optFns, c.addOperationGetFindingStatisticsMiddlewares) if err != nil { return nil, err } out := result.(*GetFindingStatisticsOutput) out.ResultMetadata = metadata return out, nil } type GetFindingStatisticsInput struct { // The finding property to use to group the query results. Valid values are: // - classificationDetails.jobId - The unique identifier for the classification // job that produced the finding. // - resourcesAffected.s3Bucket.name - The name of the S3 bucket that the // finding applies to. // - severity.description - The severity level of the finding, such as High or // Medium. // - type - The type of finding, such as Policy:IAMUser/S3BucketPublic and // SensitiveData:S3Object/Personal. // // This member is required. GroupBy types.GroupBy // The criteria to use to filter the query results. FindingCriteria *types.FindingCriteria // The maximum number of items to include in each page of the response. Size int32 // The criteria to use to sort the query results. SortCriteria *types.FindingStatisticsSortCriteria noSmithyDocumentSerde } type GetFindingStatisticsOutput struct { // An array of objects, one for each group of findings that matches the filter // criteria specified in the request. CountsByGroup []types.GroupCount // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetFindingStatisticsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetFindingStatistics{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetFindingStatistics{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetFindingStatisticsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFindingStatistics(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetFindingStatistics(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetFindingStatistics", } }
143
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves the count of Amazon Macie membership invitations that were received // by an account. func (c *Client) GetInvitationsCount(ctx context.Context, params *GetInvitationsCountInput, optFns ...func(*Options)) (*GetInvitationsCountOutput, error) { if params == nil { params = &GetInvitationsCountInput{} } result, metadata, err := c.invokeOperation(ctx, "GetInvitationsCount", params, optFns, c.addOperationGetInvitationsCountMiddlewares) if err != nil { return nil, err } out := result.(*GetInvitationsCountOutput) out.ResultMetadata = metadata return out, nil } type GetInvitationsCountInput struct { noSmithyDocumentSerde } type GetInvitationsCountOutput struct { // The total number of invitations that were received by the account, not // including the currently accepted invitation. InvitationsCount int64 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetInvitationsCountMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetInvitationsCount{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetInvitationsCount{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetInvitationsCount(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetInvitationsCount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetInvitationsCount", } }
117
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Retrieves the status and configuration settings for an Amazon Macie account. func (c *Client) GetMacieSession(ctx context.Context, params *GetMacieSessionInput, optFns ...func(*Options)) (*GetMacieSessionOutput, error) { if params == nil { params = &GetMacieSessionInput{} } result, metadata, err := c.invokeOperation(ctx, "GetMacieSession", params, optFns, c.addOperationGetMacieSessionMiddlewares) if err != nil { return nil, err } out := result.(*GetMacieSessionOutput) out.ResultMetadata = metadata return out, nil } type GetMacieSessionInput struct { noSmithyDocumentSerde } type GetMacieSessionOutput struct { // The date and time, in UTC and extended ISO 8601 format, when the Amazon Macie // account was created. CreatedAt *time.Time // The frequency with which Amazon Macie publishes updates to policy findings for // the account. This includes publishing updates to Security Hub and Amazon // EventBridge (formerly Amazon CloudWatch Events). FindingPublishingFrequency types.FindingPublishingFrequency // The Amazon Resource Name (ARN) of the service-linked role that allows Amazon // Macie to monitor and analyze data in Amazon Web Services resources for the // account. ServiceRole *string // The current status of the Amazon Macie account. Possible values are: PAUSED, // the account is enabled but all Macie activities are suspended (paused) for the // account; and, ENABLED, the account is enabled and all Macie activities are // enabled for the account. Status types.MacieStatus // The date and time, in UTC and extended ISO 8601 format, of the most recent // change to the status of the Amazon Macie account. UpdatedAt *time.Time // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetMacieSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetMacieSession{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetMacieSession{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMacieSession(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetMacieSession(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetMacieSession", } }
138
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // (Deprecated) Retrieves information about the Amazon Macie administrator account // for an account. This operation has been replaced by the GetAdministratorAccount // operation. func (c *Client) GetMasterAccount(ctx context.Context, params *GetMasterAccountInput, optFns ...func(*Options)) (*GetMasterAccountOutput, error) { if params == nil { params = &GetMasterAccountInput{} } result, metadata, err := c.invokeOperation(ctx, "GetMasterAccount", params, optFns, c.addOperationGetMasterAccountMiddlewares) if err != nil { return nil, err } out := result.(*GetMasterAccountOutput) out.ResultMetadata = metadata return out, nil } type GetMasterAccountInput struct { noSmithyDocumentSerde } type GetMasterAccountOutput struct { // (Deprecated) The Amazon Web Services account ID for the administrator account. // If the accounts are associated by a Macie membership invitation, this object // also provides details about the invitation that was sent to establish the // relationship between the accounts. Master *types.Invitation // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetMasterAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetMasterAccount{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetMasterAccount{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMasterAccount(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetMasterAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetMasterAccount", } }
121
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Retrieves information about an account that's associated with an Amazon Macie // administrator account. func (c *Client) GetMember(ctx context.Context, params *GetMemberInput, optFns ...func(*Options)) (*GetMemberOutput, error) { if params == nil { params = &GetMemberInput{} } result, metadata, err := c.invokeOperation(ctx, "GetMember", params, optFns, c.addOperationGetMemberMiddlewares) if err != nil { return nil, err } out := result.(*GetMemberOutput) out.ResultMetadata = metadata return out, nil } type GetMemberInput struct { // The unique identifier for the Amazon Macie resource that the request applies to. // // This member is required. Id *string noSmithyDocumentSerde } type GetMemberOutput struct { // The Amazon Web Services account ID for the account. AccountId *string // The Amazon Web Services account ID for the administrator account. AdministratorAccountId *string // The Amazon Resource Name (ARN) of the account. Arn *string // The email address for the account. This value is null if the account is // associated with the administrator account through Organizations. Email *string // The date and time, in UTC and extended ISO 8601 format, when an Amazon Macie // membership invitation was last sent to the account. This value is null if a // Macie membership invitation hasn't been sent to the account. InvitedAt *time.Time // (Deprecated) The Amazon Web Services account ID for the administrator account. // This property has been replaced by the administratorAccountId property and is // retained only for backward compatibility. MasterAccountId *string // The current status of the relationship between the account and the // administrator account. RelationshipStatus types.RelationshipStatus // A map of key-value pairs that specifies which tags (keys and values) are // associated with the account in Amazon Macie. Tags map[string]string // The date and time, in UTC and extended ISO 8601 format, of the most recent // change to the status of the relationship between the account and the // administrator account. UpdatedAt *time.Time // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetMemberMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetMember{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetMember{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetMemberValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMember(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetMember(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetMember", } }
160
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Retrieves (queries) sensitive data discovery statistics and the sensitivity // score for an S3 bucket. func (c *Client) GetResourceProfile(ctx context.Context, params *GetResourceProfileInput, optFns ...func(*Options)) (*GetResourceProfileOutput, error) { if params == nil { params = &GetResourceProfileInput{} } result, metadata, err := c.invokeOperation(ctx, "GetResourceProfile", params, optFns, c.addOperationGetResourceProfileMiddlewares) if err != nil { return nil, err } out := result.(*GetResourceProfileOutput) out.ResultMetadata = metadata return out, nil } type GetResourceProfileInput struct { // The Amazon Resource Name (ARN) of the S3 bucket that the request applies to. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type GetResourceProfileOutput struct { // The date and time, in UTC and extended ISO 8601 format, when Amazon Macie most // recently recalculated sensitive data discovery statistics and details for the // bucket. If the bucket's sensitivity score is calculated automatically, this // includes the score. ProfileUpdatedAt *time.Time // The current sensitivity score for the bucket, ranging from -1 (classification // error) to 100 (sensitive). By default, this score is calculated automatically // based on the amount of data that Amazon Macie has analyzed in the bucket and the // amount of sensitive data that Macie has found in the bucket. SensitivityScore int32 // Specifies whether the bucket's current sensitivity score was set manually. If // this value is true, the score was manually changed to 100. If this value is // false, the score was calculated automatically by Amazon Macie. SensitivityScoreOverridden bool // The sensitive data discovery statistics for the bucket. The statistics capture // the results of automated sensitive data discovery activities that Amazon Macie // has performed for the bucket. Statistics *types.ResourceStatistics // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetResourceProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetResourceProfile{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetResourceProfile{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetResourceProfileValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetResourceProfile(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetResourceProfile(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetResourceProfile", } }
146
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves the status and configuration settings for retrieving occurrences of // sensitive data reported by findings. func (c *Client) GetRevealConfiguration(ctx context.Context, params *GetRevealConfigurationInput, optFns ...func(*Options)) (*GetRevealConfigurationOutput, error) { if params == nil { params = &GetRevealConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "GetRevealConfiguration", params, optFns, c.addOperationGetRevealConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*GetRevealConfigurationOutput) out.ResultMetadata = metadata return out, nil } type GetRevealConfigurationInput struct { noSmithyDocumentSerde } type GetRevealConfigurationOutput struct { // The current configuration settings and the status of the configuration for the // account. Configuration *types.RevealConfiguration // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetRevealConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetRevealConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetRevealConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRevealConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetRevealConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetRevealConfiguration", } }
118
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" smithywaiter "github.com/aws/smithy-go/waiter" "github.com/jmespath/go-jmespath" "time" ) // Retrieves occurrences of sensitive data reported by a finding. func (c *Client) GetSensitiveDataOccurrences(ctx context.Context, params *GetSensitiveDataOccurrencesInput, optFns ...func(*Options)) (*GetSensitiveDataOccurrencesOutput, error) { if params == nil { params = &GetSensitiveDataOccurrencesInput{} } result, metadata, err := c.invokeOperation(ctx, "GetSensitiveDataOccurrences", params, optFns, c.addOperationGetSensitiveDataOccurrencesMiddlewares) if err != nil { return nil, err } out := result.(*GetSensitiveDataOccurrencesOutput) out.ResultMetadata = metadata return out, nil } type GetSensitiveDataOccurrencesInput struct { // The unique identifier for the finding. // // This member is required. FindingId *string noSmithyDocumentSerde } type GetSensitiveDataOccurrencesOutput struct { // If an error occurred when Amazon Macie attempted to retrieve occurrences of // sensitive data reported by the finding, a description of the error that // occurred. This value is null if the status (status) of the request is PROCESSING // or SUCCESS. Error *string // A map that specifies 1-100 types of sensitive data reported by the finding and, // for each type, 1-10 occurrences of sensitive data. SensitiveDataOccurrences map[string][]types.DetectedDataDetails // The status of the request to retrieve occurrences of sensitive data reported by // the finding. Possible values are: // - ERROR - An error occurred when Amazon Macie attempted to locate, retrieve, // or encrypt the sensitive data. The error value indicates the nature of the error // that occurred. // - PROCESSING - Macie is processing the request. // - SUCCESS - Macie successfully located, retrieved, and encrypted the // sensitive data. Status types.RevealRequestStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetSensitiveDataOccurrencesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSensitiveDataOccurrences{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSensitiveDataOccurrences{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetSensitiveDataOccurrencesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSensitiveDataOccurrences(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // GetSensitiveDataOccurrencesAPIClient is a client that implements the // GetSensitiveDataOccurrences operation. type GetSensitiveDataOccurrencesAPIClient interface { GetSensitiveDataOccurrences(context.Context, *GetSensitiveDataOccurrencesInput, ...func(*Options)) (*GetSensitiveDataOccurrencesOutput, error) } var _ GetSensitiveDataOccurrencesAPIClient = (*Client)(nil) // FindingRevealedWaiterOptions are waiter options for FindingRevealedWaiter type FindingRevealedWaiterOptions struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // MinDelay is the minimum amount of time to delay between retries. If unset, // FindingRevealedWaiter will use default minimum delay of 2 seconds. Note that // MinDelay must resolve to a value lesser than or equal to the MaxDelay. MinDelay time.Duration // MaxDelay is the maximum amount of time to delay between retries. If unset or // set to zero, FindingRevealedWaiter will use default max delay of 120 seconds. // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. MaxDelay time.Duration // LogWaitAttempts is used to enable logging for waiter retry attempts LogWaitAttempts bool // Retryable is function that can be used to override the service defined // waiter-behavior based on operation output, or returned error. This function is // used by the waiter to decide if a state is retryable or a terminal state. By // default service-modeled logic will populate this option. This option can thus be // used to define a custom waiter state with fall-back to service-modeled waiter // state mutators.The function returns an error in case of a failure state. In case // of retry state, this function returns a bool value of true and nil error, while // in case of success it returns a bool value of false and nil error. Retryable func(context.Context, *GetSensitiveDataOccurrencesInput, *GetSensitiveDataOccurrencesOutput, error) (bool, error) } // FindingRevealedWaiter defines the waiters for FindingRevealed type FindingRevealedWaiter struct { client GetSensitiveDataOccurrencesAPIClient options FindingRevealedWaiterOptions } // NewFindingRevealedWaiter constructs a FindingRevealedWaiter. func NewFindingRevealedWaiter(client GetSensitiveDataOccurrencesAPIClient, optFns ...func(*FindingRevealedWaiterOptions)) *FindingRevealedWaiter { options := FindingRevealedWaiterOptions{} options.MinDelay = 2 * time.Second options.MaxDelay = 120 * time.Second options.Retryable = findingRevealedStateRetryable for _, fn := range optFns { fn(&options) } return &FindingRevealedWaiter{ client: client, options: options, } } // Wait calls the waiter function for FindingRevealed waiter. The maxWaitDur is // the maximum wait duration the waiter will wait. The maxWaitDur is required and // must be greater than zero. func (w *FindingRevealedWaiter) Wait(ctx context.Context, params *GetSensitiveDataOccurrencesInput, maxWaitDur time.Duration, optFns ...func(*FindingRevealedWaiterOptions)) error { _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) return err } // WaitForOutput calls the waiter function for FindingRevealed waiter and returns // the output of the successful operation. The maxWaitDur is the maximum wait // duration the waiter will wait. The maxWaitDur is required and must be greater // than zero. func (w *FindingRevealedWaiter) WaitForOutput(ctx context.Context, params *GetSensitiveDataOccurrencesInput, maxWaitDur time.Duration, optFns ...func(*FindingRevealedWaiterOptions)) (*GetSensitiveDataOccurrencesOutput, error) { if maxWaitDur <= 0 { return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") } options := w.options for _, fn := range optFns { fn(&options) } if options.MaxDelay <= 0 { options.MaxDelay = 120 * time.Second } if options.MinDelay > options.MaxDelay { return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) } ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) defer cancelFn() logger := smithywaiter.Logger{} remainingTime := maxWaitDur var attempt int64 for { attempt++ apiOptions := options.APIOptions start := time.Now() if options.LogWaitAttempts { logger.Attempt = attempt apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) apiOptions = append(apiOptions, logger.AddLogger) } out, err := w.client.GetSensitiveDataOccurrences(ctx, params, func(o *Options) { o.APIOptions = append(o.APIOptions, apiOptions...) }) retryable, err := options.Retryable(ctx, params, out, err) if err != nil { return nil, err } if !retryable { return out, nil } remainingTime -= time.Since(start) if remainingTime < options.MinDelay || remainingTime <= 0 { break } // compute exponential backoff between waiter retries delay, err := smithywaiter.ComputeDelay( attempt, options.MinDelay, options.MaxDelay, remainingTime, ) if err != nil { return nil, fmt.Errorf("error computing waiter delay, %w", err) } remainingTime -= delay // sleep for the delay amount before invoking a request if err := smithytime.SleepWithContext(ctx, delay); err != nil { return nil, fmt.Errorf("request cancelled while waiting, %w", err) } } return nil, fmt.Errorf("exceeded max wait time for FindingRevealed waiter") } func findingRevealedStateRetryable(ctx context.Context, input *GetSensitiveDataOccurrencesInput, output *GetSensitiveDataOccurrencesOutput, err error) (bool, error) { if err == nil { pathValue, err := jmespath.Search("status", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "SUCCESS" value, ok := pathValue.(types.RevealRequestStatus) if !ok { return false, fmt.Errorf("waiter comparator expected types.RevealRequestStatus value, got %T", pathValue) } if string(value) == expectedValue { return false, nil } } if err == nil { pathValue, err := jmespath.Search("status", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "ERROR" value, ok := pathValue.(types.RevealRequestStatus) if !ok { return false, fmt.Errorf("waiter comparator expected types.RevealRequestStatus value, got %T", pathValue) } if string(value) == expectedValue { return false, nil } } return true, nil } func newServiceMetadataMiddleware_opGetSensitiveDataOccurrences(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetSensitiveDataOccurrences", } }
332
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Checks whether occurrences of sensitive data can be retrieved for a finding. func (c *Client) GetSensitiveDataOccurrencesAvailability(ctx context.Context, params *GetSensitiveDataOccurrencesAvailabilityInput, optFns ...func(*Options)) (*GetSensitiveDataOccurrencesAvailabilityOutput, error) { if params == nil { params = &GetSensitiveDataOccurrencesAvailabilityInput{} } result, metadata, err := c.invokeOperation(ctx, "GetSensitiveDataOccurrencesAvailability", params, optFns, c.addOperationGetSensitiveDataOccurrencesAvailabilityMiddlewares) if err != nil { return nil, err } out := result.(*GetSensitiveDataOccurrencesAvailabilityOutput) out.ResultMetadata = metadata return out, nil } type GetSensitiveDataOccurrencesAvailabilityInput struct { // The unique identifier for the finding. // // This member is required. FindingId *string noSmithyDocumentSerde } type GetSensitiveDataOccurrencesAvailabilityOutput struct { // Specifies whether occurrences of sensitive data can be retrieved for the // finding. Possible values are: AVAILABLE, the sensitive data can be retrieved; // and, UNAVAILABLE, the sensitive data can't be retrieved. If this value is // UNAVAILABLE, the reasons array indicates why the data can't be retrieved. Code types.AvailabilityCode // Specifies why occurrences of sensitive data can't be retrieved for the finding. // Possible values are: // - INVALID_CLASSIFICATION_RESULT - Amazon Macie can't verify the location of // the sensitive data to retrieve. There isn't a corresponding sensitive data // discovery result for the finding. Or the sensitive data discovery result // specified by the classificationDetails.detailedResultsLocation field of the // finding isn't available, is malformed or corrupted, or uses an unsupported // storage format. // - OBJECT_EXCEEDS_SIZE_QUOTA - The storage size of the affected S3 object // exceeds the size quota for retrieving occurrences of sensitive data. // - OBJECT_UNAVAILABLE - The affected S3 object isn't available. The object // might have been renamed, moved, or deleted. Or the object was changed after // Macie created the finding. // - UNSUPPORTED_FINDING_TYPE - The specified finding isn't a sensitive data // finding. // - UNSUPPORTED_OBJECT_TYPE - The affected S3 object uses a file or storage // format that Macie doesn't support for retrieving occurrences of sensitive data. // This value is null if sensitive data can be retrieved for the finding. Reasons []types.UnavailabilityReasonCode // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetSensitiveDataOccurrencesAvailabilityMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSensitiveDataOccurrencesAvailability{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSensitiveDataOccurrencesAvailability{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetSensitiveDataOccurrencesAvailabilityValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSensitiveDataOccurrencesAvailability(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetSensitiveDataOccurrencesAvailability(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetSensitiveDataOccurrencesAvailability", } }
148
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves the settings for the sensitivity inspection template for an account. func (c *Client) GetSensitivityInspectionTemplate(ctx context.Context, params *GetSensitivityInspectionTemplateInput, optFns ...func(*Options)) (*GetSensitivityInspectionTemplateOutput, error) { if params == nil { params = &GetSensitivityInspectionTemplateInput{} } result, metadata, err := c.invokeOperation(ctx, "GetSensitivityInspectionTemplate", params, optFns, c.addOperationGetSensitivityInspectionTemplateMiddlewares) if err != nil { return nil, err } out := result.(*GetSensitivityInspectionTemplateOutput) out.ResultMetadata = metadata return out, nil } type GetSensitivityInspectionTemplateInput struct { // The unique identifier for the Amazon Macie resource that the request applies to. // // This member is required. Id *string noSmithyDocumentSerde } type GetSensitivityInspectionTemplateOutput struct { // The custom description of the template. Description *string // The managed data identifiers that are explicitly excluded (not used) when // analyzing data. Excludes *types.SensitivityInspectionTemplateExcludes // The allow lists, custom data identifiers, and managed data identifiers that are // included (used) when analyzing data. Includes *types.SensitivityInspectionTemplateIncludes // The name of the template: automated-sensitive-data-discovery. Name *string // The unique identifier for the template. SensitivityInspectionTemplateId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetSensitivityInspectionTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSensitivityInspectionTemplate{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSensitivityInspectionTemplate{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetSensitivityInspectionTemplateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSensitivityInspectionTemplate(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetSensitivityInspectionTemplate(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetSensitivityInspectionTemplate", } }
139
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves (queries) quotas and aggregated usage data for one or more accounts. func (c *Client) GetUsageStatistics(ctx context.Context, params *GetUsageStatisticsInput, optFns ...func(*Options)) (*GetUsageStatisticsOutput, error) { if params == nil { params = &GetUsageStatisticsInput{} } result, metadata, err := c.invokeOperation(ctx, "GetUsageStatistics", params, optFns, c.addOperationGetUsageStatisticsMiddlewares) if err != nil { return nil, err } out := result.(*GetUsageStatisticsOutput) out.ResultMetadata = metadata return out, nil } type GetUsageStatisticsInput struct { // An array of objects, one for each condition to use to filter the query results. // If you specify more than one condition, Amazon Macie uses an AND operator to // join the conditions. FilterBy []types.UsageStatisticsFilter // The maximum number of items to include in each page of the response. MaxResults int32 // The nextToken string that specifies which page of results to return in a // paginated response. NextToken *string // The criteria to use to sort the query results. SortBy *types.UsageStatisticsSortBy // The inclusive time period to query usage data for. Valid values are: // MONTH_TO_DATE, for the current calendar month to date; and, PAST_30_DAYS, for // the preceding 30 days. If you don't specify a value, Amazon Macie provides usage // data for the preceding 30 days. TimeRange types.TimeRange noSmithyDocumentSerde } type GetUsageStatisticsOutput struct { // The string to use in a subsequent request to get the next page of results in a // paginated response. This value is null if there are no additional pages. NextToken *string // An array of objects that contains the results of the query. Each object // contains the data for an account that matches the filter criteria specified in // the request. Records []types.UsageRecord // The inclusive time period that the usage data applies to. Possible values are: // MONTH_TO_DATE, for the current calendar month to date; and, PAST_30_DAYS, for // the preceding 30 days. TimeRange types.TimeRange // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetUsageStatisticsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetUsageStatistics{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetUsageStatistics{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetUsageStatistics(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // GetUsageStatisticsAPIClient is a client that implements the GetUsageStatistics // operation. type GetUsageStatisticsAPIClient interface { GetUsageStatistics(context.Context, *GetUsageStatisticsInput, ...func(*Options)) (*GetUsageStatisticsOutput, error) } var _ GetUsageStatisticsAPIClient = (*Client)(nil) // GetUsageStatisticsPaginatorOptions is the paginator options for // GetUsageStatistics type GetUsageStatisticsPaginatorOptions struct { // The maximum number of items to include in each page of the response. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // GetUsageStatisticsPaginator is a paginator for GetUsageStatistics type GetUsageStatisticsPaginator struct { options GetUsageStatisticsPaginatorOptions client GetUsageStatisticsAPIClient params *GetUsageStatisticsInput nextToken *string firstPage bool } // NewGetUsageStatisticsPaginator returns a new GetUsageStatisticsPaginator func NewGetUsageStatisticsPaginator(client GetUsageStatisticsAPIClient, params *GetUsageStatisticsInput, optFns ...func(*GetUsageStatisticsPaginatorOptions)) *GetUsageStatisticsPaginator { if params == nil { params = &GetUsageStatisticsInput{} } options := GetUsageStatisticsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &GetUsageStatisticsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *GetUsageStatisticsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next GetUsageStatistics page. func (p *GetUsageStatisticsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetUsageStatisticsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.GetUsageStatistics(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opGetUsageStatistics(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetUsageStatistics", } }
237
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves (queries) aggregated usage data for an account. func (c *Client) GetUsageTotals(ctx context.Context, params *GetUsageTotalsInput, optFns ...func(*Options)) (*GetUsageTotalsOutput, error) { if params == nil { params = &GetUsageTotalsInput{} } result, metadata, err := c.invokeOperation(ctx, "GetUsageTotals", params, optFns, c.addOperationGetUsageTotalsMiddlewares) if err != nil { return nil, err } out := result.(*GetUsageTotalsOutput) out.ResultMetadata = metadata return out, nil } type GetUsageTotalsInput struct { // The inclusive time period to retrieve the data for. Valid values are: // MONTH_TO_DATE, for the current calendar month to date; and, PAST_30_DAYS, for // the preceding 30 days. If you don't specify a value for this parameter, Amazon // Macie provides aggregated usage data for the preceding 30 days. TimeRange *string noSmithyDocumentSerde } type GetUsageTotalsOutput struct { // The inclusive time period that the usage data applies to. Possible values are: // MONTH_TO_DATE, for the current calendar month to date; and, PAST_30_DAYS, for // the preceding 30 days. TimeRange types.TimeRange // An array of objects that contains the results of the query. Each object // contains the data for a specific usage metric. UsageTotals []types.UsageTotal // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetUsageTotalsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetUsageTotals{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetUsageTotals{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetUsageTotals(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opGetUsageTotals(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "GetUsageTotals", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves a subset of information about all the allow lists for an account. func (c *Client) ListAllowLists(ctx context.Context, params *ListAllowListsInput, optFns ...func(*Options)) (*ListAllowListsOutput, error) { if params == nil { params = &ListAllowListsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListAllowLists", params, optFns, c.addOperationListAllowListsMiddlewares) if err != nil { return nil, err } out := result.(*ListAllowListsOutput) out.ResultMetadata = metadata return out, nil } type ListAllowListsInput struct { // The maximum number of items to include in each page of a paginated response. MaxResults int32 // The nextToken string that specifies which page of results to return in a // paginated response. NextToken *string noSmithyDocumentSerde } type ListAllowListsOutput struct { // An array of objects, one for each allow list. AllowLists []types.AllowListSummary // The string to use in a subsequent request to get the next page of results in a // paginated response. This value is null if there are no additional pages. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListAllowListsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListAllowLists{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAllowLists{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAllowLists(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListAllowListsAPIClient is a client that implements the ListAllowLists // operation. type ListAllowListsAPIClient interface { ListAllowLists(context.Context, *ListAllowListsInput, ...func(*Options)) (*ListAllowListsOutput, error) } var _ ListAllowListsAPIClient = (*Client)(nil) // ListAllowListsPaginatorOptions is the paginator options for ListAllowLists type ListAllowListsPaginatorOptions struct { // The maximum number of items to include in each page of a paginated response. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListAllowListsPaginator is a paginator for ListAllowLists type ListAllowListsPaginator struct { options ListAllowListsPaginatorOptions client ListAllowListsAPIClient params *ListAllowListsInput nextToken *string firstPage bool } // NewListAllowListsPaginator returns a new ListAllowListsPaginator func NewListAllowListsPaginator(client ListAllowListsAPIClient, params *ListAllowListsInput, optFns ...func(*ListAllowListsPaginatorOptions)) *ListAllowListsPaginator { if params == nil { params = &ListAllowListsInput{} } options := ListAllowListsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListAllowListsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListAllowListsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListAllowLists page. func (p *ListAllowListsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAllowListsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListAllowLists(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListAllowLists(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "ListAllowLists", } }
215
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves a subset of information about one or more classification jobs. func (c *Client) ListClassificationJobs(ctx context.Context, params *ListClassificationJobsInput, optFns ...func(*Options)) (*ListClassificationJobsOutput, error) { if params == nil { params = &ListClassificationJobsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListClassificationJobs", params, optFns, c.addOperationListClassificationJobsMiddlewares) if err != nil { return nil, err } out := result.(*ListClassificationJobsOutput) out.ResultMetadata = metadata return out, nil } type ListClassificationJobsInput struct { // The criteria to use to filter the results. FilterCriteria *types.ListJobsFilterCriteria // The maximum number of items to include in each page of the response. MaxResults int32 // The nextToken string that specifies which page of results to return in a // paginated response. NextToken *string // The criteria to use to sort the results. SortCriteria *types.ListJobsSortCriteria noSmithyDocumentSerde } type ListClassificationJobsOutput struct { // An array of objects, one for each job that matches the filter criteria // specified in the request. Items []types.JobSummary // The string to use in a subsequent request to get the next page of results in a // paginated response. This value is null if there are no additional pages. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListClassificationJobsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListClassificationJobs{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListClassificationJobs{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListClassificationJobs(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListClassificationJobsAPIClient is a client that implements the // ListClassificationJobs operation. type ListClassificationJobsAPIClient interface { ListClassificationJobs(context.Context, *ListClassificationJobsInput, ...func(*Options)) (*ListClassificationJobsOutput, error) } var _ ListClassificationJobsAPIClient = (*Client)(nil) // ListClassificationJobsPaginatorOptions is the paginator options for // ListClassificationJobs type ListClassificationJobsPaginatorOptions struct { // The maximum number of items to include in each page of the response. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListClassificationJobsPaginator is a paginator for ListClassificationJobs type ListClassificationJobsPaginator struct { options ListClassificationJobsPaginatorOptions client ListClassificationJobsAPIClient params *ListClassificationJobsInput nextToken *string firstPage bool } // NewListClassificationJobsPaginator returns a new ListClassificationJobsPaginator func NewListClassificationJobsPaginator(client ListClassificationJobsAPIClient, params *ListClassificationJobsInput, optFns ...func(*ListClassificationJobsPaginatorOptions)) *ListClassificationJobsPaginator { if params == nil { params = &ListClassificationJobsInput{} } options := ListClassificationJobsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListClassificationJobsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListClassificationJobsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListClassificationJobs page. func (p *ListClassificationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClassificationJobsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListClassificationJobs(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListClassificationJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "ListClassificationJobs", } }
223
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves a subset of information about the classification scope for an account. func (c *Client) ListClassificationScopes(ctx context.Context, params *ListClassificationScopesInput, optFns ...func(*Options)) (*ListClassificationScopesOutput, error) { if params == nil { params = &ListClassificationScopesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListClassificationScopes", params, optFns, c.addOperationListClassificationScopesMiddlewares) if err != nil { return nil, err } out := result.(*ListClassificationScopesOutput) out.ResultMetadata = metadata return out, nil } type ListClassificationScopesInput struct { // The name of the classification scope to retrieve the unique identifier for. Name *string // The nextToken string that specifies which page of results to return in a // paginated response. NextToken *string noSmithyDocumentSerde } type ListClassificationScopesOutput struct { // An array that specifies the unique identifier and name of the classification // scope for the account. ClassificationScopes []types.ClassificationScopeSummary // The string to use in a subsequent request to get the next page of results in a // paginated response. This value is null if there are no additional pages. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListClassificationScopesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListClassificationScopes{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListClassificationScopes{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListClassificationScopes(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListClassificationScopesAPIClient is a client that implements the // ListClassificationScopes operation. type ListClassificationScopesAPIClient interface { ListClassificationScopes(context.Context, *ListClassificationScopesInput, ...func(*Options)) (*ListClassificationScopesOutput, error) } var _ ListClassificationScopesAPIClient = (*Client)(nil) // ListClassificationScopesPaginatorOptions is the paginator options for // ListClassificationScopes type ListClassificationScopesPaginatorOptions struct { // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListClassificationScopesPaginator is a paginator for ListClassificationScopes type ListClassificationScopesPaginator struct { options ListClassificationScopesPaginatorOptions client ListClassificationScopesAPIClient params *ListClassificationScopesInput nextToken *string firstPage bool } // NewListClassificationScopesPaginator returns a new // ListClassificationScopesPaginator func NewListClassificationScopesPaginator(client ListClassificationScopesAPIClient, params *ListClassificationScopesInput, optFns ...func(*ListClassificationScopesPaginatorOptions)) *ListClassificationScopesPaginator { if params == nil { params = &ListClassificationScopesInput{} } options := ListClassificationScopesPaginatorOptions{} for _, fn := range optFns { fn(&options) } return &ListClassificationScopesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListClassificationScopesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListClassificationScopes page. func (p *ListClassificationScopesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClassificationScopesOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken result, err := p.client.ListClassificationScopes(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListClassificationScopes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "ListClassificationScopes", } }
210
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves a subset of information about all the custom data identifiers for an // account. func (c *Client) ListCustomDataIdentifiers(ctx context.Context, params *ListCustomDataIdentifiersInput, optFns ...func(*Options)) (*ListCustomDataIdentifiersOutput, error) { if params == nil { params = &ListCustomDataIdentifiersInput{} } result, metadata, err := c.invokeOperation(ctx, "ListCustomDataIdentifiers", params, optFns, c.addOperationListCustomDataIdentifiersMiddlewares) if err != nil { return nil, err } out := result.(*ListCustomDataIdentifiersOutput) out.ResultMetadata = metadata return out, nil } type ListCustomDataIdentifiersInput struct { // The maximum number of items to include in each page of the response. MaxResults int32 // The nextToken string that specifies which page of results to return in a // paginated response. NextToken *string noSmithyDocumentSerde } type ListCustomDataIdentifiersOutput struct { // An array of objects, one for each custom data identifier. Items []types.CustomDataIdentifierSummary // The string to use in a subsequent request to get the next page of results in a // paginated response. This value is null if there are no additional pages. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListCustomDataIdentifiersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListCustomDataIdentifiers{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCustomDataIdentifiers{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCustomDataIdentifiers(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListCustomDataIdentifiersAPIClient is a client that implements the // ListCustomDataIdentifiers operation. type ListCustomDataIdentifiersAPIClient interface { ListCustomDataIdentifiers(context.Context, *ListCustomDataIdentifiersInput, ...func(*Options)) (*ListCustomDataIdentifiersOutput, error) } var _ ListCustomDataIdentifiersAPIClient = (*Client)(nil) // ListCustomDataIdentifiersPaginatorOptions is the paginator options for // ListCustomDataIdentifiers type ListCustomDataIdentifiersPaginatorOptions struct { // The maximum number of items to include in each page of the response. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListCustomDataIdentifiersPaginator is a paginator for ListCustomDataIdentifiers type ListCustomDataIdentifiersPaginator struct { options ListCustomDataIdentifiersPaginatorOptions client ListCustomDataIdentifiersAPIClient params *ListCustomDataIdentifiersInput nextToken *string firstPage bool } // NewListCustomDataIdentifiersPaginator returns a new // ListCustomDataIdentifiersPaginator func NewListCustomDataIdentifiersPaginator(client ListCustomDataIdentifiersAPIClient, params *ListCustomDataIdentifiersInput, optFns ...func(*ListCustomDataIdentifiersPaginatorOptions)) *ListCustomDataIdentifiersPaginator { if params == nil { params = &ListCustomDataIdentifiersInput{} } options := ListCustomDataIdentifiersPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListCustomDataIdentifiersPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListCustomDataIdentifiersPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListCustomDataIdentifiers page. func (p *ListCustomDataIdentifiersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCustomDataIdentifiersOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListCustomDataIdentifiers(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListCustomDataIdentifiers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "ListCustomDataIdentifiers", } }
218
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves a subset of information about one or more findings. func (c *Client) ListFindings(ctx context.Context, params *ListFindingsInput, optFns ...func(*Options)) (*ListFindingsOutput, error) { if params == nil { params = &ListFindingsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListFindings", params, optFns, c.addOperationListFindingsMiddlewares) if err != nil { return nil, err } out := result.(*ListFindingsOutput) out.ResultMetadata = metadata return out, nil } type ListFindingsInput struct { // The criteria to use to filter the results. FindingCriteria *types.FindingCriteria // The maximum number of items to include in each page of the response. MaxResults int32 // The nextToken string that specifies which page of results to return in a // paginated response. NextToken *string // The criteria to use to sort the results. SortCriteria *types.SortCriteria noSmithyDocumentSerde } type ListFindingsOutput struct { // An array of strings, where each string is the unique identifier for a finding // that matches the filter criteria specified in the request. FindingIds []string // The string to use in a subsequent request to get the next page of results in a // paginated response. This value is null if there are no additional pages. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListFindingsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListFindings{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListFindings{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFindings(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListFindingsAPIClient is a client that implements the ListFindings operation. type ListFindingsAPIClient interface { ListFindings(context.Context, *ListFindingsInput, ...func(*Options)) (*ListFindingsOutput, error) } var _ ListFindingsAPIClient = (*Client)(nil) // ListFindingsPaginatorOptions is the paginator options for ListFindings type ListFindingsPaginatorOptions struct { // The maximum number of items to include in each page of the response. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListFindingsPaginator is a paginator for ListFindings type ListFindingsPaginator struct { options ListFindingsPaginatorOptions client ListFindingsAPIClient params *ListFindingsInput nextToken *string firstPage bool } // NewListFindingsPaginator returns a new ListFindingsPaginator func NewListFindingsPaginator(client ListFindingsAPIClient, params *ListFindingsInput, optFns ...func(*ListFindingsPaginatorOptions)) *ListFindingsPaginator { if params == nil { params = &ListFindingsInput{} } options := ListFindingsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListFindingsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListFindingsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListFindings page. func (p *ListFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFindingsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListFindings(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListFindings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "ListFindings", } }
221
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves a subset of information about all the findings filters for an account. func (c *Client) ListFindingsFilters(ctx context.Context, params *ListFindingsFiltersInput, optFns ...func(*Options)) (*ListFindingsFiltersOutput, error) { if params == nil { params = &ListFindingsFiltersInput{} } result, metadata, err := c.invokeOperation(ctx, "ListFindingsFilters", params, optFns, c.addOperationListFindingsFiltersMiddlewares) if err != nil { return nil, err } out := result.(*ListFindingsFiltersOutput) out.ResultMetadata = metadata return out, nil } type ListFindingsFiltersInput struct { // The maximum number of items to include in each page of a paginated response. MaxResults int32 // The nextToken string that specifies which page of results to return in a // paginated response. NextToken *string noSmithyDocumentSerde } type ListFindingsFiltersOutput struct { // An array of objects, one for each filter that's associated with the account. FindingsFilterListItems []types.FindingsFilterListItem // The string to use in a subsequent request to get the next page of results in a // paginated response. This value is null if there are no additional pages. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListFindingsFiltersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListFindingsFilters{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListFindingsFilters{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFindingsFilters(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListFindingsFiltersAPIClient is a client that implements the // ListFindingsFilters operation. type ListFindingsFiltersAPIClient interface { ListFindingsFilters(context.Context, *ListFindingsFiltersInput, ...func(*Options)) (*ListFindingsFiltersOutput, error) } var _ ListFindingsFiltersAPIClient = (*Client)(nil) // ListFindingsFiltersPaginatorOptions is the paginator options for // ListFindingsFilters type ListFindingsFiltersPaginatorOptions struct { // The maximum number of items to include in each page of a paginated response. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListFindingsFiltersPaginator is a paginator for ListFindingsFilters type ListFindingsFiltersPaginator struct { options ListFindingsFiltersPaginatorOptions client ListFindingsFiltersAPIClient params *ListFindingsFiltersInput nextToken *string firstPage bool } // NewListFindingsFiltersPaginator returns a new ListFindingsFiltersPaginator func NewListFindingsFiltersPaginator(client ListFindingsFiltersAPIClient, params *ListFindingsFiltersInput, optFns ...func(*ListFindingsFiltersPaginatorOptions)) *ListFindingsFiltersPaginator { if params == nil { params = &ListFindingsFiltersInput{} } options := ListFindingsFiltersPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListFindingsFiltersPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListFindingsFiltersPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListFindingsFilters page. func (p *ListFindingsFiltersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFindingsFiltersOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListFindingsFilters(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListFindingsFilters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "ListFindingsFilters", } }
216
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about the Amazon Macie membership invitations that were // received by an account. func (c *Client) ListInvitations(ctx context.Context, params *ListInvitationsInput, optFns ...func(*Options)) (*ListInvitationsOutput, error) { if params == nil { params = &ListInvitationsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListInvitations", params, optFns, c.addOperationListInvitationsMiddlewares) if err != nil { return nil, err } out := result.(*ListInvitationsOutput) out.ResultMetadata = metadata return out, nil } type ListInvitationsInput struct { // The maximum number of items to include in each page of a paginated response. MaxResults int32 // The nextToken string that specifies which page of results to return in a // paginated response. NextToken *string noSmithyDocumentSerde } type ListInvitationsOutput struct { // An array of objects, one for each invitation that was received by the account. Invitations []types.Invitation // The string to use in a subsequent request to get the next page of results in a // paginated response. This value is null if there are no additional pages. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListInvitationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListInvitations{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListInvitations{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListInvitations(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListInvitationsAPIClient is a client that implements the ListInvitations // operation. type ListInvitationsAPIClient interface { ListInvitations(context.Context, *ListInvitationsInput, ...func(*Options)) (*ListInvitationsOutput, error) } var _ ListInvitationsAPIClient = (*Client)(nil) // ListInvitationsPaginatorOptions is the paginator options for ListInvitations type ListInvitationsPaginatorOptions struct { // The maximum number of items to include in each page of a paginated response. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListInvitationsPaginator is a paginator for ListInvitations type ListInvitationsPaginator struct { options ListInvitationsPaginatorOptions client ListInvitationsAPIClient params *ListInvitationsInput nextToken *string firstPage bool } // NewListInvitationsPaginator returns a new ListInvitationsPaginator func NewListInvitationsPaginator(client ListInvitationsAPIClient, params *ListInvitationsInput, optFns ...func(*ListInvitationsPaginatorOptions)) *ListInvitationsPaginator { if params == nil { params = &ListInvitationsInput{} } options := ListInvitationsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListInvitationsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListInvitationsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListInvitations page. func (p *ListInvitationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInvitationsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListInvitations(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListInvitations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "ListInvitations", } }
216
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about all the managed data identifiers that Amazon Macie // currently provides. func (c *Client) ListManagedDataIdentifiers(ctx context.Context, params *ListManagedDataIdentifiersInput, optFns ...func(*Options)) (*ListManagedDataIdentifiersOutput, error) { if params == nil { params = &ListManagedDataIdentifiersInput{} } result, metadata, err := c.invokeOperation(ctx, "ListManagedDataIdentifiers", params, optFns, c.addOperationListManagedDataIdentifiersMiddlewares) if err != nil { return nil, err } out := result.(*ListManagedDataIdentifiersOutput) out.ResultMetadata = metadata return out, nil } type ListManagedDataIdentifiersInput struct { // The nextToken string that specifies which page of results to return in a // paginated response. NextToken *string noSmithyDocumentSerde } type ListManagedDataIdentifiersOutput struct { // An array of objects, one for each managed data identifier. Items []types.ManagedDataIdentifierSummary // The string to use in a subsequent request to get the next page of results in a // paginated response. This value is null if there are no additional pages. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListManagedDataIdentifiersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListManagedDataIdentifiers{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListManagedDataIdentifiers{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListManagedDataIdentifiers(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListManagedDataIdentifiersAPIClient is a client that implements the // ListManagedDataIdentifiers operation. type ListManagedDataIdentifiersAPIClient interface { ListManagedDataIdentifiers(context.Context, *ListManagedDataIdentifiersInput, ...func(*Options)) (*ListManagedDataIdentifiersOutput, error) } var _ ListManagedDataIdentifiersAPIClient = (*Client)(nil) // ListManagedDataIdentifiersPaginatorOptions is the paginator options for // ListManagedDataIdentifiers type ListManagedDataIdentifiersPaginatorOptions struct { // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListManagedDataIdentifiersPaginator is a paginator for // ListManagedDataIdentifiers type ListManagedDataIdentifiersPaginator struct { options ListManagedDataIdentifiersPaginatorOptions client ListManagedDataIdentifiersAPIClient params *ListManagedDataIdentifiersInput nextToken *string firstPage bool } // NewListManagedDataIdentifiersPaginator returns a new // ListManagedDataIdentifiersPaginator func NewListManagedDataIdentifiersPaginator(client ListManagedDataIdentifiersAPIClient, params *ListManagedDataIdentifiersInput, optFns ...func(*ListManagedDataIdentifiersPaginatorOptions)) *ListManagedDataIdentifiersPaginator { if params == nil { params = &ListManagedDataIdentifiersInput{} } options := ListManagedDataIdentifiersPaginatorOptions{} for _, fn := range optFns { fn(&options) } return &ListManagedDataIdentifiersPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListManagedDataIdentifiersPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListManagedDataIdentifiers page. func (p *ListManagedDataIdentifiersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListManagedDataIdentifiersOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken result, err := p.client.ListManagedDataIdentifiers(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListManagedDataIdentifiers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "ListManagedDataIdentifiers", } }
208
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about the accounts that are associated with an Amazon // Macie administrator account. func (c *Client) ListMembers(ctx context.Context, params *ListMembersInput, optFns ...func(*Options)) (*ListMembersOutput, error) { if params == nil { params = &ListMembersInput{} } result, metadata, err := c.invokeOperation(ctx, "ListMembers", params, optFns, c.addOperationListMembersMiddlewares) if err != nil { return nil, err } out := result.(*ListMembersOutput) out.ResultMetadata = metadata return out, nil } type ListMembersInput struct { // The maximum number of items to include in each page of a paginated response. MaxResults int32 // The nextToken string that specifies which page of results to return in a // paginated response. NextToken *string // Specifies which accounts to include in the response, based on the status of an // account's relationship with the administrator account. By default, the response // includes only current member accounts. To include all accounts, set this value // to false. OnlyAssociated *string noSmithyDocumentSerde } type ListMembersOutput struct { // An array of objects, one for each account that's associated with the // administrator account and matches the criteria specified in the request. Members []types.Member // The string to use in a subsequent request to get the next page of results in a // paginated response. This value is null if there are no additional pages. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListMembersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListMembers{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListMembers{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListMembers(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListMembersAPIClient is a client that implements the ListMembers operation. type ListMembersAPIClient interface { ListMembers(context.Context, *ListMembersInput, ...func(*Options)) (*ListMembersOutput, error) } var _ ListMembersAPIClient = (*Client)(nil) // ListMembersPaginatorOptions is the paginator options for ListMembers type ListMembersPaginatorOptions struct { // The maximum number of items to include in each page of a paginated response. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListMembersPaginator is a paginator for ListMembers type ListMembersPaginator struct { options ListMembersPaginatorOptions client ListMembersAPIClient params *ListMembersInput nextToken *string firstPage bool } // NewListMembersPaginator returns a new ListMembersPaginator func NewListMembersPaginator(client ListMembersAPIClient, params *ListMembersInput, optFns ...func(*ListMembersPaginatorOptions)) *ListMembersPaginator { if params == nil { params = &ListMembersInput{} } options := ListMembersPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListMembersPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListMembersPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListMembers page. func (p *ListMembersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMembersOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListMembers(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListMembers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "ListMembers", } }
222
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about the delegated Amazon Macie administrator account // for an organization in Organizations. func (c *Client) ListOrganizationAdminAccounts(ctx context.Context, params *ListOrganizationAdminAccountsInput, optFns ...func(*Options)) (*ListOrganizationAdminAccountsOutput, error) { if params == nil { params = &ListOrganizationAdminAccountsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListOrganizationAdminAccounts", params, optFns, c.addOperationListOrganizationAdminAccountsMiddlewares) if err != nil { return nil, err } out := result.(*ListOrganizationAdminAccountsOutput) out.ResultMetadata = metadata return out, nil } type ListOrganizationAdminAccountsInput struct { // The maximum number of items to include in each page of a paginated response. MaxResults int32 // The nextToken string that specifies which page of results to return in a // paginated response. NextToken *string noSmithyDocumentSerde } type ListOrganizationAdminAccountsOutput struct { // An array of objects, one for each delegated Amazon Macie administrator account // for the organization. Only one of these accounts can have a status of ENABLED. AdminAccounts []types.AdminAccount // The string to use in a subsequent request to get the next page of results in a // paginated response. This value is null if there are no additional pages. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListOrganizationAdminAccountsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListOrganizationAdminAccounts{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListOrganizationAdminAccounts{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListOrganizationAdminAccounts(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListOrganizationAdminAccountsAPIClient is a client that implements the // ListOrganizationAdminAccounts operation. type ListOrganizationAdminAccountsAPIClient interface { ListOrganizationAdminAccounts(context.Context, *ListOrganizationAdminAccountsInput, ...func(*Options)) (*ListOrganizationAdminAccountsOutput, error) } var _ ListOrganizationAdminAccountsAPIClient = (*Client)(nil) // ListOrganizationAdminAccountsPaginatorOptions is the paginator options for // ListOrganizationAdminAccounts type ListOrganizationAdminAccountsPaginatorOptions struct { // The maximum number of items to include in each page of a paginated response. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListOrganizationAdminAccountsPaginator is a paginator for // ListOrganizationAdminAccounts type ListOrganizationAdminAccountsPaginator struct { options ListOrganizationAdminAccountsPaginatorOptions client ListOrganizationAdminAccountsAPIClient params *ListOrganizationAdminAccountsInput nextToken *string firstPage bool } // NewListOrganizationAdminAccountsPaginator returns a new // ListOrganizationAdminAccountsPaginator func NewListOrganizationAdminAccountsPaginator(client ListOrganizationAdminAccountsAPIClient, params *ListOrganizationAdminAccountsInput, optFns ...func(*ListOrganizationAdminAccountsPaginatorOptions)) *ListOrganizationAdminAccountsPaginator { if params == nil { params = &ListOrganizationAdminAccountsInput{} } options := ListOrganizationAdminAccountsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListOrganizationAdminAccountsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListOrganizationAdminAccountsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListOrganizationAdminAccounts page. func (p *ListOrganizationAdminAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOrganizationAdminAccountsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListOrganizationAdminAccounts(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListOrganizationAdminAccounts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "ListOrganizationAdminAccounts", } }
220
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about objects that were selected from an S3 bucket for // automated sensitive data discovery. func (c *Client) ListResourceProfileArtifacts(ctx context.Context, params *ListResourceProfileArtifactsInput, optFns ...func(*Options)) (*ListResourceProfileArtifactsOutput, error) { if params == nil { params = &ListResourceProfileArtifactsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListResourceProfileArtifacts", params, optFns, c.addOperationListResourceProfileArtifactsMiddlewares) if err != nil { return nil, err } out := result.(*ListResourceProfileArtifactsOutput) out.ResultMetadata = metadata return out, nil } type ListResourceProfileArtifactsInput struct { // The Amazon Resource Name (ARN) of the S3 bucket that the request applies to. // // This member is required. ResourceArn *string // The nextToken string that specifies which page of results to return in a // paginated response. NextToken *string noSmithyDocumentSerde } type ListResourceProfileArtifactsOutput struct { // An array of objects, one for each of 1-100 S3 objects that Amazon Macie // selected for analysis. If Macie has analyzed more than 100 objects in the // bucket, Macie populates the array based on the value for the // ResourceProfileArtifact.sensitive field for an object: true (sensitive), // followed by false (not sensitive). Macie then populates any remaining items in // the array with information about objects where the value for the // ResourceProfileArtifact.classificationResultStatus field is SKIPPED. Artifacts []types.ResourceProfileArtifact // The string to use in a subsequent request to get the next page of results in a // paginated response. This value is null if there are no additional pages. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListResourceProfileArtifactsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListResourceProfileArtifacts{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListResourceProfileArtifacts{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListResourceProfileArtifactsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListResourceProfileArtifacts(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListResourceProfileArtifactsAPIClient is a client that implements the // ListResourceProfileArtifacts operation. type ListResourceProfileArtifactsAPIClient interface { ListResourceProfileArtifacts(context.Context, *ListResourceProfileArtifactsInput, ...func(*Options)) (*ListResourceProfileArtifactsOutput, error) } var _ ListResourceProfileArtifactsAPIClient = (*Client)(nil) // ListResourceProfileArtifactsPaginatorOptions is the paginator options for // ListResourceProfileArtifacts type ListResourceProfileArtifactsPaginatorOptions struct { // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListResourceProfileArtifactsPaginator is a paginator for // ListResourceProfileArtifacts type ListResourceProfileArtifactsPaginator struct { options ListResourceProfileArtifactsPaginatorOptions client ListResourceProfileArtifactsAPIClient params *ListResourceProfileArtifactsInput nextToken *string firstPage bool } // NewListResourceProfileArtifactsPaginator returns a new // ListResourceProfileArtifactsPaginator func NewListResourceProfileArtifactsPaginator(client ListResourceProfileArtifactsAPIClient, params *ListResourceProfileArtifactsInput, optFns ...func(*ListResourceProfileArtifactsPaginatorOptions)) *ListResourceProfileArtifactsPaginator { if params == nil { params = &ListResourceProfileArtifactsInput{} } options := ListResourceProfileArtifactsPaginatorOptions{} for _, fn := range optFns { fn(&options) } return &ListResourceProfileArtifactsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListResourceProfileArtifactsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListResourceProfileArtifacts page. func (p *ListResourceProfileArtifactsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourceProfileArtifactsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken result, err := p.client.ListResourceProfileArtifacts(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListResourceProfileArtifacts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "ListResourceProfileArtifacts", } }
222
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about the types and amount of sensitive data that Amazon // Macie found in an S3 bucket. func (c *Client) ListResourceProfileDetections(ctx context.Context, params *ListResourceProfileDetectionsInput, optFns ...func(*Options)) (*ListResourceProfileDetectionsOutput, error) { if params == nil { params = &ListResourceProfileDetectionsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListResourceProfileDetections", params, optFns, c.addOperationListResourceProfileDetectionsMiddlewares) if err != nil { return nil, err } out := result.(*ListResourceProfileDetectionsOutput) out.ResultMetadata = metadata return out, nil } type ListResourceProfileDetectionsInput struct { // The Amazon Resource Name (ARN) of the S3 bucket that the request applies to. // // This member is required. ResourceArn *string // The maximum number of items to include in each page of a paginated response. MaxResults int32 // The nextToken string that specifies which page of results to return in a // paginated response. NextToken *string noSmithyDocumentSerde } type ListResourceProfileDetectionsOutput struct { // An array of objects, one for each type of sensitive data that Amazon Macie // found in the bucket. Each object reports the number of occurrences of the // specified type and provides information about the custom data identifier or // managed data identifier that detected the data. Detections []types.Detection // The string to use in a subsequent request to get the next page of results in a // paginated response. This value is null if there are no additional pages. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListResourceProfileDetectionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListResourceProfileDetections{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListResourceProfileDetections{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListResourceProfileDetectionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListResourceProfileDetections(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListResourceProfileDetectionsAPIClient is a client that implements the // ListResourceProfileDetections operation. type ListResourceProfileDetectionsAPIClient interface { ListResourceProfileDetections(context.Context, *ListResourceProfileDetectionsInput, ...func(*Options)) (*ListResourceProfileDetectionsOutput, error) } var _ ListResourceProfileDetectionsAPIClient = (*Client)(nil) // ListResourceProfileDetectionsPaginatorOptions is the paginator options for // ListResourceProfileDetections type ListResourceProfileDetectionsPaginatorOptions struct { // The maximum number of items to include in each page of a paginated response. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListResourceProfileDetectionsPaginator is a paginator for // ListResourceProfileDetections type ListResourceProfileDetectionsPaginator struct { options ListResourceProfileDetectionsPaginatorOptions client ListResourceProfileDetectionsAPIClient params *ListResourceProfileDetectionsInput nextToken *string firstPage bool } // NewListResourceProfileDetectionsPaginator returns a new // ListResourceProfileDetectionsPaginator func NewListResourceProfileDetectionsPaginator(client ListResourceProfileDetectionsAPIClient, params *ListResourceProfileDetectionsInput, optFns ...func(*ListResourceProfileDetectionsPaginatorOptions)) *ListResourceProfileDetectionsPaginator { if params == nil { params = &ListResourceProfileDetectionsInput{} } options := ListResourceProfileDetectionsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListResourceProfileDetectionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListResourceProfileDetectionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListResourceProfileDetections page. func (p *ListResourceProfileDetectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourceProfileDetectionsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListResourceProfileDetections(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListResourceProfileDetections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "ListResourceProfileDetections", } }
230
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves a subset of information about the sensitivity inspection template for // an account. func (c *Client) ListSensitivityInspectionTemplates(ctx context.Context, params *ListSensitivityInspectionTemplatesInput, optFns ...func(*Options)) (*ListSensitivityInspectionTemplatesOutput, error) { if params == nil { params = &ListSensitivityInspectionTemplatesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListSensitivityInspectionTemplates", params, optFns, c.addOperationListSensitivityInspectionTemplatesMiddlewares) if err != nil { return nil, err } out := result.(*ListSensitivityInspectionTemplatesOutput) out.ResultMetadata = metadata return out, nil } type ListSensitivityInspectionTemplatesInput struct { // The maximum number of items to include in each page of a paginated response. MaxResults int32 // The nextToken string that specifies which page of results to return in a // paginated response. NextToken *string noSmithyDocumentSerde } type ListSensitivityInspectionTemplatesOutput struct { // The string to use in a subsequent request to get the next page of results in a // paginated response. This value is null if there are no additional pages. NextToken *string // An array that specifies the unique identifier and name of the sensitivity // inspection template for the account. SensitivityInspectionTemplates []types.SensitivityInspectionTemplatesEntry // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListSensitivityInspectionTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListSensitivityInspectionTemplates{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSensitivityInspectionTemplates{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSensitivityInspectionTemplates(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListSensitivityInspectionTemplatesAPIClient is a client that implements the // ListSensitivityInspectionTemplates operation. type ListSensitivityInspectionTemplatesAPIClient interface { ListSensitivityInspectionTemplates(context.Context, *ListSensitivityInspectionTemplatesInput, ...func(*Options)) (*ListSensitivityInspectionTemplatesOutput, error) } var _ ListSensitivityInspectionTemplatesAPIClient = (*Client)(nil) // ListSensitivityInspectionTemplatesPaginatorOptions is the paginator options for // ListSensitivityInspectionTemplates type ListSensitivityInspectionTemplatesPaginatorOptions struct { // The maximum number of items to include in each page of a paginated response. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListSensitivityInspectionTemplatesPaginator is a paginator for // ListSensitivityInspectionTemplates type ListSensitivityInspectionTemplatesPaginator struct { options ListSensitivityInspectionTemplatesPaginatorOptions client ListSensitivityInspectionTemplatesAPIClient params *ListSensitivityInspectionTemplatesInput nextToken *string firstPage bool } // NewListSensitivityInspectionTemplatesPaginator returns a new // ListSensitivityInspectionTemplatesPaginator func NewListSensitivityInspectionTemplatesPaginator(client ListSensitivityInspectionTemplatesAPIClient, params *ListSensitivityInspectionTemplatesInput, optFns ...func(*ListSensitivityInspectionTemplatesPaginatorOptions)) *ListSensitivityInspectionTemplatesPaginator { if params == nil { params = &ListSensitivityInspectionTemplatesInput{} } options := ListSensitivityInspectionTemplatesPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListSensitivityInspectionTemplatesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListSensitivityInspectionTemplatesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListSensitivityInspectionTemplates page. func (p *ListSensitivityInspectionTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSensitivityInspectionTemplatesOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListSensitivityInspectionTemplates(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListSensitivityInspectionTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "ListSensitivityInspectionTemplates", } }
220
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves the tags (keys and values) that are associated with an Amazon Macie // resource. func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { params = &ListTagsForResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) if err != nil { return nil, err } out := result.(*ListTagsForResourceOutput) out.ResultMetadata = metadata return out, nil } type ListTagsForResourceInput struct { // The Amazon Resource Name (ARN) of the resource. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type ListTagsForResourceOutput struct { // A map of key-value pairs that specifies which tags (keys and values) are // associated with the resource. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "ListTagsForResource", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates or updates the configuration settings for storing data classification // results. func (c *Client) PutClassificationExportConfiguration(ctx context.Context, params *PutClassificationExportConfigurationInput, optFns ...func(*Options)) (*PutClassificationExportConfigurationOutput, error) { if params == nil { params = &PutClassificationExportConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "PutClassificationExportConfiguration", params, optFns, c.addOperationPutClassificationExportConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*PutClassificationExportConfigurationOutput) out.ResultMetadata = metadata return out, nil } type PutClassificationExportConfigurationInput struct { // The location to store data classification results in, and the encryption // settings to use when storing results in that location. // // This member is required. Configuration *types.ClassificationExportConfiguration noSmithyDocumentSerde } type PutClassificationExportConfigurationOutput struct { // The location where the data classification results are stored, and the // encryption settings that are used when storing results in that location. Configuration *types.ClassificationExportConfiguration // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationPutClassificationExportConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpPutClassificationExportConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutClassificationExportConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPutClassificationExportConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutClassificationExportConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opPutClassificationExportConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "PutClassificationExportConfiguration", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the configuration settings for publishing findings to Security Hub. func (c *Client) PutFindingsPublicationConfiguration(ctx context.Context, params *PutFindingsPublicationConfigurationInput, optFns ...func(*Options)) (*PutFindingsPublicationConfigurationOutput, error) { if params == nil { params = &PutFindingsPublicationConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "PutFindingsPublicationConfiguration", params, optFns, c.addOperationPutFindingsPublicationConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*PutFindingsPublicationConfigurationOutput) out.ResultMetadata = metadata return out, nil } type PutFindingsPublicationConfigurationInput struct { // A unique, case-sensitive token that you provide to ensure the idempotency of // the request. ClientToken *string // The configuration settings that determine which findings to publish to Security // Hub. SecurityHubConfiguration *types.SecurityHubConfiguration noSmithyDocumentSerde } type PutFindingsPublicationConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationPutFindingsPublicationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpPutFindingsPublicationConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutFindingsPublicationConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addIdempotencyToken_opPutFindingsPublicationConfigurationMiddleware(stack, options); err != nil { return err } if err = addOpPutFindingsPublicationConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutFindingsPublicationConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } type idempotencyToken_initializeOpPutFindingsPublicationConfiguration struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpPutFindingsPublicationConfiguration) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpPutFindingsPublicationConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*PutFindingsPublicationConfigurationInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *PutFindingsPublicationConfigurationInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opPutFindingsPublicationConfigurationMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpPutFindingsPublicationConfiguration{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opPutFindingsPublicationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "PutFindingsPublicationConfiguration", } }
161
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves (queries) statistical data and other information about Amazon Web // Services resources that Amazon Macie monitors and analyzes. func (c *Client) SearchResources(ctx context.Context, params *SearchResourcesInput, optFns ...func(*Options)) (*SearchResourcesOutput, error) { if params == nil { params = &SearchResourcesInput{} } result, metadata, err := c.invokeOperation(ctx, "SearchResources", params, optFns, c.addOperationSearchResourcesMiddlewares) if err != nil { return nil, err } out := result.(*SearchResourcesOutput) out.ResultMetadata = metadata return out, nil } type SearchResourcesInput struct { // The filter conditions that determine which S3 buckets to include or exclude // from the query results. BucketCriteria *types.SearchResourcesBucketCriteria // The maximum number of items to include in each page of the response. The // default value is 50. MaxResults int32 // The nextToken string that specifies which page of results to return in a // paginated response. NextToken *string // The criteria to use to sort the results. SortCriteria *types.SearchResourcesSortCriteria noSmithyDocumentSerde } type SearchResourcesOutput struct { // An array of objects, one for each resource that matches the filter criteria // specified in the request. MatchingResources []types.MatchingResource // The string to use in a subsequent request to get the next page of results in a // paginated response. This value is null if there are no additional pages. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationSearchResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpSearchResources{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearchResources{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchResources(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // SearchResourcesAPIClient is a client that implements the SearchResources // operation. type SearchResourcesAPIClient interface { SearchResources(context.Context, *SearchResourcesInput, ...func(*Options)) (*SearchResourcesOutput, error) } var _ SearchResourcesAPIClient = (*Client)(nil) // SearchResourcesPaginatorOptions is the paginator options for SearchResources type SearchResourcesPaginatorOptions struct { // The maximum number of items to include in each page of the response. The // default value is 50. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // SearchResourcesPaginator is a paginator for SearchResources type SearchResourcesPaginator struct { options SearchResourcesPaginatorOptions client SearchResourcesAPIClient params *SearchResourcesInput nextToken *string firstPage bool } // NewSearchResourcesPaginator returns a new SearchResourcesPaginator func NewSearchResourcesPaginator(client SearchResourcesAPIClient, params *SearchResourcesInput, optFns ...func(*SearchResourcesPaginatorOptions)) *SearchResourcesPaginator { if params == nil { params = &SearchResourcesInput{} } options := SearchResourcesPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &SearchResourcesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *SearchResourcesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next SearchResources page. func (p *SearchResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchResourcesOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.SearchResources(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opSearchResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "SearchResources", } }
226
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Adds or updates one or more tags (keys and values) that are associated with an // Amazon Macie resource. func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { params = &TagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) if err != nil { return nil, err } out := result.(*TagResourceOutput) out.ResultMetadata = metadata return out, nil } type TagResourceInput struct { // The Amazon Resource Name (ARN) of the resource. // // This member is required. ResourceArn *string // A map of key-value pairs that specifies the tags to associate with the // resource. A resource can have a maximum of 50 tags. Each tag consists of a tag // key and an associated tag value. The maximum length of a tag key is 128 // characters. The maximum length of a tag value is 256 characters. // // This member is required. Tags map[string]string noSmithyDocumentSerde } type TagResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpTagResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "TagResource", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Tests a custom data identifier. func (c *Client) TestCustomDataIdentifier(ctx context.Context, params *TestCustomDataIdentifierInput, optFns ...func(*Options)) (*TestCustomDataIdentifierOutput, error) { if params == nil { params = &TestCustomDataIdentifierInput{} } result, metadata, err := c.invokeOperation(ctx, "TestCustomDataIdentifier", params, optFns, c.addOperationTestCustomDataIdentifierMiddlewares) if err != nil { return nil, err } out := result.(*TestCustomDataIdentifierOutput) out.ResultMetadata = metadata return out, nil } type TestCustomDataIdentifierInput struct { // The regular expression (regex) that defines the pattern to match. The // expression can contain as many as 512 characters. // // This member is required. Regex *string // The sample text to inspect by using the custom data identifier. The text can // contain as many as 1,000 characters. // // This member is required. SampleText *string // An array that lists specific character sequences (ignore words) to exclude from // the results. If the text matched by the regular expression contains any string // in this array, Amazon Macie ignores it. The array can contain as many as 10 // ignore words. Each ignore word can contain 4-90 UTF-8 characters. Ignore words // are case sensitive. IgnoreWords []string // An array that lists specific character sequences (keywords), one of which must // precede and be within proximity (maximumMatchDistance) of the regular expression // to match. The array can contain as many as 50 keywords. Each keyword can contain // 3-90 UTF-8 characters. Keywords aren't case sensitive. Keywords []string // The maximum number of characters that can exist between the end of at least one // complete character sequence specified by the keywords array and the end of the // text that matches the regex pattern. If a complete keyword precedes all the text // that matches the pattern and the keyword is within the specified distance, // Amazon Macie includes the result. The distance can be 1-300 characters. The // default value is 50. MaximumMatchDistance int32 noSmithyDocumentSerde } type TestCustomDataIdentifierOutput struct { // The number of occurrences of sample text that matched the criteria specified by // the custom data identifier. MatchCount int32 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTestCustomDataIdentifierMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpTestCustomDataIdentifier{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTestCustomDataIdentifier{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpTestCustomDataIdentifierValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTestCustomDataIdentifier(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opTestCustomDataIdentifier(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "TestCustomDataIdentifier", } }
153
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Removes one or more tags (keys and values) from an Amazon Macie resource. func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { params = &UntagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) if err != nil { return nil, err } out := result.(*UntagResourceOutput) out.ResultMetadata = metadata return out, nil } type UntagResourceInput struct { // The Amazon Resource Name (ARN) of the resource. // // This member is required. ResourceArn *string // One or more tags (keys) to remove from the resource. In an HTTP request to // remove multiple tags, append the tagKeys parameter and argument for each tag to // remove, separated by an ampersand (&). // // This member is required. TagKeys []string noSmithyDocumentSerde } type UntagResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUntagResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "UntagResource", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the settings for an allow list. func (c *Client) UpdateAllowList(ctx context.Context, params *UpdateAllowListInput, optFns ...func(*Options)) (*UpdateAllowListOutput, error) { if params == nil { params = &UpdateAllowListInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateAllowList", params, optFns, c.addOperationUpdateAllowListMiddlewares) if err != nil { return nil, err } out := result.(*UpdateAllowListOutput) out.ResultMetadata = metadata return out, nil } type UpdateAllowListInput struct { // The criteria that specify the text or text pattern to ignore. The criteria can // be the location and name of an S3 object that lists specific text to ignore // (s3WordsList), or a regular expression that defines a text pattern to ignore // (regex). You can change a list's underlying criteria, such as the name of the S3 // object or the regular expression to use. However, you can't change the type from // s3WordsList to regex or the other way around. // // This member is required. Criteria *types.AllowListCriteria // The unique identifier for the Amazon Macie resource that the request applies to. // // This member is required. Id *string // A custom name for the allow list. The name can contain as many as 128 // characters. // // This member is required. Name *string // A custom description of the allow list. The description can contain as many as // 512 characters. Description *string noSmithyDocumentSerde } type UpdateAllowListOutput struct { // The Amazon Resource Name (ARN) of the allow list. Arn *string // The unique identifier for the allow list. Id *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateAllowListMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAllowList{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAllowList{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateAllowListValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAllowList(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opUpdateAllowList(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "UpdateAllowList", } }
148
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Enables or disables automated sensitive data discovery for an account. func (c *Client) UpdateAutomatedDiscoveryConfiguration(ctx context.Context, params *UpdateAutomatedDiscoveryConfigurationInput, optFns ...func(*Options)) (*UpdateAutomatedDiscoveryConfigurationOutput, error) { if params == nil { params = &UpdateAutomatedDiscoveryConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateAutomatedDiscoveryConfiguration", params, optFns, c.addOperationUpdateAutomatedDiscoveryConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*UpdateAutomatedDiscoveryConfigurationOutput) out.ResultMetadata = metadata return out, nil } type UpdateAutomatedDiscoveryConfigurationInput struct { // The new status of automated sensitive data discovery for the account. Valid // values are: ENABLED, start or resume automated sensitive data discovery // activities for the account; and, DISABLED, stop performing automated sensitive // data discovery activities for the account. When you enable automated sensitive // data discovery for the first time, Amazon Macie uses default configuration // settings to determine which data sources to analyze and which managed data // identifiers to use. To change these settings, use the UpdateClassificationScope // and UpdateSensitivityInspectionTemplate operations, respectively. If you change // the settings and subsequently disable the configuration, Amazon Macie retains // your changes. // // This member is required. Status types.AutomatedDiscoveryStatus noSmithyDocumentSerde } type UpdateAutomatedDiscoveryConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateAutomatedDiscoveryConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAutomatedDiscoveryConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAutomatedDiscoveryConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateAutomatedDiscoveryConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAutomatedDiscoveryConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opUpdateAutomatedDiscoveryConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "UpdateAutomatedDiscoveryConfiguration", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Changes the status of a classification job. func (c *Client) UpdateClassificationJob(ctx context.Context, params *UpdateClassificationJobInput, optFns ...func(*Options)) (*UpdateClassificationJobOutput, error) { if params == nil { params = &UpdateClassificationJobInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateClassificationJob", params, optFns, c.addOperationUpdateClassificationJobMiddlewares) if err != nil { return nil, err } out := result.(*UpdateClassificationJobOutput) out.ResultMetadata = metadata return out, nil } type UpdateClassificationJobInput struct { // The unique identifier for the classification job. // // This member is required. JobId *string // The new status for the job. Valid values are: // - CANCELLED - Stops the job permanently and cancels it. This value is valid // only if the job's current status is IDLE, PAUSED, RUNNING, or USER_PAUSED. If // you specify this value and the job's current status is RUNNING, Amazon Macie // immediately begins to stop all processing tasks for the job. You can't resume or // restart a job after you cancel it. // - RUNNING - Resumes the job. This value is valid only if the job's current // status is USER_PAUSED. If you paused the job while it was actively running and // you specify this value less than 30 days after you paused the job, Macie // immediately resumes processing from the point where you paused the job. // Otherwise, Macie resumes the job according to the schedule and other settings // for the job. // - USER_PAUSED - Pauses the job temporarily. This value is valid only if the // job's current status is IDLE, PAUSED, or RUNNING. If you specify this value and // the job's current status is RUNNING, Macie immediately begins to pause all // processing tasks for the job. If you pause a one-time job and you don't resume // it within 30 days, the job expires and Macie cancels the job. If you pause a // recurring job when its status is RUNNING and you don't resume it within 30 days, // the job run expires and Macie cancels the run. To check the expiration date, // refer to the UserPausedDetails.jobExpiresAt property. // // This member is required. JobStatus types.JobStatus noSmithyDocumentSerde } type UpdateClassificationJobOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateClassificationJobMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateClassificationJob{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateClassificationJob{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateClassificationJobValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateClassificationJob(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opUpdateClassificationJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "UpdateClassificationJob", } }
145
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the classification scope settings for an account. func (c *Client) UpdateClassificationScope(ctx context.Context, params *UpdateClassificationScopeInput, optFns ...func(*Options)) (*UpdateClassificationScopeOutput, error) { if params == nil { params = &UpdateClassificationScopeInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateClassificationScope", params, optFns, c.addOperationUpdateClassificationScopeMiddlewares) if err != nil { return nil, err } out := result.(*UpdateClassificationScopeOutput) out.ResultMetadata = metadata return out, nil } type UpdateClassificationScopeInput struct { // The unique identifier for the Amazon Macie resource that the request applies to. // // This member is required. Id *string // The S3 buckets to add or remove from the exclusion list defined by the // classification scope. S3 *types.S3ClassificationScopeUpdate noSmithyDocumentSerde } type UpdateClassificationScopeOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateClassificationScopeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateClassificationScope{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateClassificationScope{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateClassificationScopeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateClassificationScope(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opUpdateClassificationScope(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "UpdateClassificationScope", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the criteria and other settings for a findings filter. func (c *Client) UpdateFindingsFilter(ctx context.Context, params *UpdateFindingsFilterInput, optFns ...func(*Options)) (*UpdateFindingsFilterOutput, error) { if params == nil { params = &UpdateFindingsFilterInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateFindingsFilter", params, optFns, c.addOperationUpdateFindingsFilterMiddlewares) if err != nil { return nil, err } out := result.(*UpdateFindingsFilterOutput) out.ResultMetadata = metadata return out, nil } type UpdateFindingsFilterInput struct { // The unique identifier for the Amazon Macie resource that the request applies to. // // This member is required. Id *string // The action to perform on findings that match the filter criteria // (findingCriteria). Valid values are: ARCHIVE, suppress (automatically archive) // the findings; and, NOOP, don't perform any action on the findings. Action types.FindingsFilterAction // A unique, case-sensitive token that you provide to ensure the idempotency of // the request. ClientToken *string // A custom description of the filter. The description can contain as many as 512 // characters. We strongly recommend that you avoid including any sensitive data in // the description of a filter. Other users of your account might be able to see // this description, depending on the actions that they're allowed to perform in // Amazon Macie. Description *string // The criteria to use to filter findings. FindingCriteria *types.FindingCriteria // A custom name for the filter. The name must contain at least 3 characters and // can contain as many as 64 characters. We strongly recommend that you avoid // including any sensitive data in the name of a filter. Other users of your // account might be able to see this name, depending on the actions that they're // allowed to perform in Amazon Macie. Name *string // The position of the filter in the list of saved filters on the Amazon Macie // console. This value also determines the order in which the filter is applied to // findings, relative to other filters that are also applied to the findings. Position int32 noSmithyDocumentSerde } type UpdateFindingsFilterOutput struct { // The Amazon Resource Name (ARN) of the filter that was updated. Arn *string // The unique identifier for the filter that was updated. Id *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateFindingsFilterMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateFindingsFilter{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateFindingsFilter{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addIdempotencyToken_opUpdateFindingsFilterMiddleware(stack, options); err != nil { return err } if err = addOpUpdateFindingsFilterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateFindingsFilter(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } type idempotencyToken_initializeOpUpdateFindingsFilter struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpUpdateFindingsFilter) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpUpdateFindingsFilter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*UpdateFindingsFilterInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateFindingsFilterInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opUpdateFindingsFilterMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateFindingsFilter{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opUpdateFindingsFilter(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "UpdateFindingsFilter", } }
196
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Suspends or re-enables Amazon Macie, or updates the configuration settings for // a Macie account. func (c *Client) UpdateMacieSession(ctx context.Context, params *UpdateMacieSessionInput, optFns ...func(*Options)) (*UpdateMacieSessionOutput, error) { if params == nil { params = &UpdateMacieSessionInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateMacieSession", params, optFns, c.addOperationUpdateMacieSessionMiddlewares) if err != nil { return nil, err } out := result.(*UpdateMacieSessionOutput) out.ResultMetadata = metadata return out, nil } type UpdateMacieSessionInput struct { // Specifies how often to publish updates to policy findings for the account. This // includes publishing updates to Security Hub and Amazon EventBridge (formerly // Amazon CloudWatch Events). FindingPublishingFrequency types.FindingPublishingFrequency // Specifies a new status for the account. Valid values are: ENABLED, resume all // Amazon Macie activities for the account; and, PAUSED, suspend all Macie // activities for the account. Status types.MacieStatus noSmithyDocumentSerde } type UpdateMacieSessionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateMacieSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateMacieSession{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateMacieSession{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateMacieSession(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opUpdateMacieSession(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "UpdateMacieSession", } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Enables an Amazon Macie administrator to suspend or re-enable Macie for a // member account. func (c *Client) UpdateMemberSession(ctx context.Context, params *UpdateMemberSessionInput, optFns ...func(*Options)) (*UpdateMemberSessionOutput, error) { if params == nil { params = &UpdateMemberSessionInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateMemberSession", params, optFns, c.addOperationUpdateMemberSessionMiddlewares) if err != nil { return nil, err } out := result.(*UpdateMemberSessionOutput) out.ResultMetadata = metadata return out, nil } type UpdateMemberSessionInput struct { // The unique identifier for the Amazon Macie resource that the request applies to. // // This member is required. Id *string // Specifies the new status for the account. Valid values are: ENABLED, resume all // Amazon Macie activities for the account; and, PAUSED, suspend all Macie // activities for the account. // // This member is required. Status types.MacieStatus noSmithyDocumentSerde } type UpdateMemberSessionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateMemberSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateMemberSession{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateMemberSession{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateMemberSessionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateMemberSession(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opUpdateMemberSession(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "UpdateMemberSession", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the Amazon Macie configuration settings for an organization in // Organizations. func (c *Client) UpdateOrganizationConfiguration(ctx context.Context, params *UpdateOrganizationConfigurationInput, optFns ...func(*Options)) (*UpdateOrganizationConfigurationOutput, error) { if params == nil { params = &UpdateOrganizationConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateOrganizationConfiguration", params, optFns, c.addOperationUpdateOrganizationConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*UpdateOrganizationConfigurationOutput) out.ResultMetadata = metadata return out, nil } type UpdateOrganizationConfigurationInput struct { // Specifies whether to enable Amazon Macie automatically for an account when the // account is added to the organization in Organizations. // // This member is required. AutoEnable bool noSmithyDocumentSerde } type UpdateOrganizationConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateOrganizationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateOrganizationConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateOrganizationConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateOrganizationConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateOrganizationConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opUpdateOrganizationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "UpdateOrganizationConfiguration", } }
122
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the sensitivity score for an S3 bucket. func (c *Client) UpdateResourceProfile(ctx context.Context, params *UpdateResourceProfileInput, optFns ...func(*Options)) (*UpdateResourceProfileOutput, error) { if params == nil { params = &UpdateResourceProfileInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateResourceProfile", params, optFns, c.addOperationUpdateResourceProfileMiddlewares) if err != nil { return nil, err } out := result.(*UpdateResourceProfileOutput) out.ResultMetadata = metadata return out, nil } type UpdateResourceProfileInput struct { // The Amazon Resource Name (ARN) of the S3 bucket that the request applies to. // // This member is required. ResourceArn *string // The new sensitivity score for the bucket. Valid values are: 100, assign the // maximum score and apply the Sensitive label to the bucket; and, null (empty), // assign a score that Amazon Macie calculates automatically after you submit the // request. SensitivityScoreOverride int32 noSmithyDocumentSerde } type UpdateResourceProfileOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateResourceProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateResourceProfile{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateResourceProfile{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateResourceProfileValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateResourceProfile(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opUpdateResourceProfile(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "UpdateResourceProfile", } }
126