Skip to content

Commit 9695325

Browse files
author
awstools
committed
feat(client-iotfleetwise): Refine campaign related API validations
1 parent 88ca256 commit 9695325

File tree

5 files changed

+108
-22
lines changed

5 files changed

+108
-22
lines changed

clients/client-iotfleetwise/src/commands/CreateCampaignCommand.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { commonParams } from "../endpoint/EndpointParameters";
88
import { IoTFleetWiseClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IoTFleetWiseClient";
9-
import { CreateCampaignRequest, CreateCampaignResponse } from "../models/models_0";
9+
import {
10+
CreateCampaignRequest,
11+
CreateCampaignRequestFilterSensitiveLog,
12+
CreateCampaignResponse,
13+
} from "../models/models_0";
1014
import { de_CreateCampaignCommand, se_CreateCampaignCommand } from "../protocols/Aws_json1_0";
1115

1216
/**
@@ -153,7 +157,7 @@ export class CreateCampaignCommand extends $Command
153157
})
154158
.s("IoTAutobahnControlPlane", "CreateCampaign", {})
155159
.n("IoTFleetWiseClient", "CreateCampaignCommand")
156-
.f(void 0, void 0)
160+
.f(CreateCampaignRequestFilterSensitiveLog, void 0)
157161
.ser(se_CreateCampaignCommand)
158162
.de(de_CreateCampaignCommand)
159163
.build() {

clients/client-iotfleetwise/src/commands/GetCampaignCommand.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { commonParams } from "../endpoint/EndpointParameters";
88
import { IoTFleetWiseClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IoTFleetWiseClient";
9-
import { GetCampaignRequest, GetCampaignResponse } from "../models/models_0";
9+
import { GetCampaignRequest, GetCampaignResponse, GetCampaignResponseFilterSensitiveLog } from "../models/models_0";
1010
import { de_GetCampaignCommand, se_GetCampaignCommand } from "../protocols/Aws_json1_0";
1111

1212
/**
@@ -138,7 +138,7 @@ export class GetCampaignCommand extends $Command
138138
})
139139
.s("IoTAutobahnControlPlane", "GetCampaign", {})
140140
.n("IoTFleetWiseClient", "GetCampaignCommand")
141-
.f(void 0, void 0)
141+
.f(void 0, GetCampaignResponseFilterSensitiveLog)
142142
.ser(se_GetCampaignCommand)
143143
.de(de_GetCampaignCommand)
144144
.build() {

clients/client-iotfleetwise/src/commands/UpdateCampaignCommand.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { commonParams } from "../endpoint/EndpointParameters";
88
import { IoTFleetWiseClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IoTFleetWiseClient";
9-
import { UpdateCampaignRequest, UpdateCampaignResponse } from "../models/models_0";
9+
import {
10+
UpdateCampaignRequest,
11+
UpdateCampaignRequestFilterSensitiveLog,
12+
UpdateCampaignResponse,
13+
} from "../models/models_0";
1014
import { de_UpdateCampaignCommand, se_UpdateCampaignCommand } from "../protocols/Aws_json1_0";
1115

1216
/**
@@ -100,7 +104,7 @@ export class UpdateCampaignCommand extends $Command
100104
})
101105
.s("IoTAutobahnControlPlane", "UpdateCampaign", {})
102106
.n("IoTFleetWiseClient", "UpdateCampaignCommand")
103-
.f(void 0, void 0)
107+
.f(UpdateCampaignRequestFilterSensitiveLog, void 0)
104108
.ser(se_UpdateCampaignCommand)
105109
.de(de_UpdateCampaignCommand)
106110
.build() {

clients/client-iotfleetwise/src/models/models_0.ts

+55-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// smithy-typescript generated code
2-
import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client";
2+
import { ExceptionOptionType as __ExceptionOptionType, SENSITIVE_STRING } from "@smithy/smithy-client";
33

44
import { IoTFleetWiseServiceException as __BaseException } from "./IoTFleetWiseServiceException";
55

@@ -1229,6 +1229,8 @@ export interface CreateCampaignRequest {
12291229
compression?: Compression;
12301230

12311231
/**
1232+
* @deprecated
1233+
*
12321234
* <p>(Optional) A number indicating the priority of one campaign over another campaign for
12331235
* a certain vehicle or fleet. A campaign with the lowest value is deployed to vehicles
12341236
* before any other campaigns. If it's not specified, <code>0</code> is used. </p>
@@ -5420,3 +5422,55 @@ export interface UpdateDecoderManifestRequest {
54205422
*/
54215423
status?: ManifestStatus;
54225424
}
5425+
5426+
/**
5427+
* @internal
5428+
*/
5429+
export const ConditionBasedCollectionSchemeFilterSensitiveLog = (obj: ConditionBasedCollectionScheme): any => ({
5430+
...obj,
5431+
...(obj.expression && { expression: SENSITIVE_STRING }),
5432+
});
5433+
5434+
/**
5435+
* @internal
5436+
*/
5437+
export const CollectionSchemeFilterSensitiveLog = (obj: CollectionScheme): any => {
5438+
if (obj.timeBasedCollectionScheme !== undefined) return { timeBasedCollectionScheme: obj.timeBasedCollectionScheme };
5439+
if (obj.conditionBasedCollectionScheme !== undefined)
5440+
return {
5441+
conditionBasedCollectionScheme: ConditionBasedCollectionSchemeFilterSensitiveLog(
5442+
obj.conditionBasedCollectionScheme
5443+
),
5444+
};
5445+
if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" };
5446+
};
5447+
5448+
/**
5449+
* @internal
5450+
*/
5451+
export const CreateCampaignRequestFilterSensitiveLog = (obj: CreateCampaignRequest): any => ({
5452+
...obj,
5453+
...(obj.signalsToCollect && { signalsToCollect: SENSITIVE_STRING }),
5454+
...(obj.collectionScheme && { collectionScheme: CollectionSchemeFilterSensitiveLog(obj.collectionScheme) }),
5455+
...(obj.dataExtraDimensions && { dataExtraDimensions: SENSITIVE_STRING }),
5456+
...(obj.dataDestinationConfigs && { dataDestinationConfigs: obj.dataDestinationConfigs.map((item) => item) }),
5457+
});
5458+
5459+
/**
5460+
* @internal
5461+
*/
5462+
export const GetCampaignResponseFilterSensitiveLog = (obj: GetCampaignResponse): any => ({
5463+
...obj,
5464+
...(obj.signalsToCollect && { signalsToCollect: SENSITIVE_STRING }),
5465+
...(obj.collectionScheme && { collectionScheme: CollectionSchemeFilterSensitiveLog(obj.collectionScheme) }),
5466+
...(obj.dataExtraDimensions && { dataExtraDimensions: SENSITIVE_STRING }),
5467+
...(obj.dataDestinationConfigs && { dataDestinationConfigs: obj.dataDestinationConfigs.map((item) => item) }),
5468+
});
5469+
5470+
/**
5471+
* @internal
5472+
*/
5473+
export const UpdateCampaignRequestFilterSensitiveLog = (obj: UpdateCampaignRequest): any => ({
5474+
...obj,
5475+
...(obj.dataExtraDimensions && { dataExtraDimensions: SENSITIVE_STRING }),
5476+
});

codegen/sdk-codegen/aws-models/iotfleetwise.json

+39-15
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@
102102
"smithy.api#length": {
103103
"min": 1,
104104
"max": 1011
105-
}
105+
},
106+
"smithy.api#pattern": "^arn:.*"
106107
}
107108
},
108109
"com.amazonaws.iotfleetwise#AssociateVehicleFleet": {
@@ -463,7 +464,7 @@
463464
"type": "structure",
464465
"members": {
465466
"arn": {
466-
"target": "com.amazonaws.iotfleetwise#arn",
467+
"target": "com.amazonaws.iotfleetwise#campaignArn",
467468
"traits": {
468469
"smithy.api#documentation": "<p>The Amazon Resource Name (ARN) of a campaign.</p>"
469470
}
@@ -897,6 +898,9 @@
897898
"priority": {
898899
"target": "com.amazonaws.iotfleetwise#priority",
899900
"traits": {
901+
"smithy.api#deprecated": {
902+
"message": "priority is no longer used or needed as input"
903+
},
900904
"smithy.api#documentation": "<p>(Optional) A number indicating the priority of one campaign over another campaign for\n a certain vehicle or fleet. A campaign with the lowest value is deployed to vehicles\n before any other campaigns. If it's not specified, <code>0</code> is used. </p>\n <p>Default: <code>0</code>\n </p>"
901905
}
902906
},
@@ -943,7 +947,7 @@
943947
}
944948
},
945949
"arn": {
946-
"target": "com.amazonaws.iotfleetwise#arn",
950+
"target": "com.amazonaws.iotfleetwise#campaignArn",
947951
"traits": {
948952
"smithy.api#documentation": "<p> The ARN of the created campaign. </p>"
949953
}
@@ -1667,10 +1671,12 @@
16671671
"target": "com.amazonaws.iotfleetwise#NodePath"
16681672
},
16691673
"traits": {
1674+
"aws.api#data": "content",
16701675
"smithy.api#length": {
16711676
"min": 0,
16721677
"max": 5
1673-
}
1678+
},
1679+
"smithy.api#sensitive": {}
16741680
}
16751681
},
16761682
"com.amazonaws.iotfleetwise#DataFormat": {
@@ -1868,7 +1874,7 @@
18681874
}
18691875
},
18701876
"arn": {
1871-
"target": "com.amazonaws.iotfleetwise#arn",
1877+
"target": "com.amazonaws.iotfleetwise#campaignArn",
18721878
"traits": {
18731879
"smithy.api#documentation": "<p> The Amazon Resource Name (ARN) of the deleted campaign.</p>\n <note>\n <p>The ARN isn’t returned if a campaign doesn’t exist.</p>\n </note>"
18741880
}
@@ -2503,7 +2509,7 @@
25032509
}
25042510
},
25052511
"arn": {
2506-
"target": "com.amazonaws.iotfleetwise#arn",
2512+
"target": "com.amazonaws.iotfleetwise#campaignArn",
25072513
"traits": {
25082514
"smithy.api#documentation": "<p> The Amazon Resource Name (ARN) of the campaign. </p>"
25092515
}
@@ -4592,7 +4598,7 @@
45924598
}
45934599
},
45944600
"status": {
4595-
"target": "com.amazonaws.iotfleetwise#status",
4601+
"target": "com.amazonaws.iotfleetwise#statusStr",
45964602
"traits": {
45974603
"smithy.api#documentation": "<p>Optional parameter to filter the results by the status of each created campaign in\n your account. The status can be one of: <code>CREATING</code>,\n <code>WAITING_FOR_APPROVAL</code>, <code>RUNNING</code>, or\n <code>SUSPENDED</code>.</p>",
45984604
"smithy.api#httpQuery": "status"
@@ -7290,10 +7296,12 @@
72907296
"target": "com.amazonaws.iotfleetwise#SignalInformation"
72917297
},
72927298
"traits": {
7299+
"aws.api#data": "content",
72937300
"smithy.api#length": {
72947301
"min": 0,
72957302
"max": 1000
7296-
}
7303+
},
7304+
"smithy.api#sensitive": {}
72977305
}
72987306
},
72997307
"com.amazonaws.iotfleetwise#SignalNodeType": {
@@ -7983,7 +7991,7 @@
79837991
"type": "structure",
79847992
"members": {
79857993
"arn": {
7986-
"target": "com.amazonaws.iotfleetwise#arn",
7994+
"target": "com.amazonaws.iotfleetwise#campaignArn",
79877995
"traits": {
79887996
"smithy.api#documentation": "<p> The Amazon Resource Name (ARN) of the campaign. </p>"
79897997
}
@@ -8829,7 +8837,7 @@
88298837
"type": "structure",
88308838
"members": {
88318839
"campaignName": {
8832-
"target": "com.amazonaws.iotfleetwise#string",
8840+
"target": "com.amazonaws.iotfleetwise#campaignName",
88338841
"traits": {
88348842
"smithy.api#documentation": "<p>The name of a campaign.</p>"
88358843
}
@@ -8962,6 +8970,12 @@
89628970
"target": "com.amazonaws.iotfleetwise#attributeValue"
89638971
}
89648972
},
8973+
"com.amazonaws.iotfleetwise#campaignArn": {
8974+
"type": "string",
8975+
"traits": {
8976+
"smithy.api#pattern": "^arn:aws:iotfleetwise:[a-z0-9-]+:[0-9]{12}:campaign/[a-zA-Z\\d\\-_:]{1,100}$"
8977+
}
8978+
},
89658979
"com.amazonaws.iotfleetwise#campaignName": {
89668980
"type": "string",
89678981
"traits": {
@@ -8983,7 +8997,7 @@
89838997
"traits": {
89848998
"smithy.api#range": {
89858999
"min": 10000,
8986-
"max": 60000
9000+
"max": 86400000
89879001
}
89889002
}
89899003
},
@@ -9038,10 +9052,12 @@
90389052
"com.amazonaws.iotfleetwise#eventExpression": {
90399053
"type": "string",
90409054
"traits": {
9055+
"aws.api#data": "content",
90419056
"smithy.api#length": {
90429057
"min": 1,
90439058
"max": 2048
9044-
}
9059+
},
9060+
"smithy.api#sensitive": {}
90459061
}
90469062
},
90479063
"com.amazonaws.iotfleetwise#fleetId": {
@@ -9070,7 +9086,8 @@
90709086
"type": "integer",
90719087
"traits": {
90729088
"smithy.api#range": {
9073-
"min": 1
9089+
"min": 1,
9090+
"max": 1
90749091
}
90759092
}
90769093
},
@@ -9188,8 +9205,15 @@
91889205
"target": "com.amazonaws.iotfleetwise#SignalCatalogSummary"
91899206
}
91909207
},
9191-
"com.amazonaws.iotfleetwise#status": {
9192-
"type": "string"
9208+
"com.amazonaws.iotfleetwise#statusStr": {
9209+
"type": "string",
9210+
"traits": {
9211+
"smithy.api#length": {
9212+
"min": 7,
9213+
"max": 20
9214+
},
9215+
"smithy.api#pattern": "^[A-Z_]*$"
9216+
}
91939217
},
91949218
"com.amazonaws.iotfleetwise#string": {
91959219
"type": "string"

0 commit comments

Comments
 (0)