Chilkat Online Tools

ListSecrets unicodeC Example

AWS Secrets Manager

void ChilkatSample(void)
    {

    CkAuthAwsW_putAccessKey(authAws,L"AWS_ACCESS_KEY");    CkAuthAwsW_putSecretKey(authAws,L"AWS_SECRET_KEY");    CkAuthAwsW_putRegion(authAws,L"us-west-2");    CkAuthAwsW_putServiceName(authAws,L"secretsmanager");    CkRestW_SetAuthAws(rest,authAws);    success = CkRestW_Connect(rest,L"secretsmanager.us-west-2.amazonaws.com",443,TRUE,TRUE);    CkJsonObjectW_UpdateString(json,L"Filters[0].Key",L"string");    CkJsonObjectW_UpdateString(json,L"Filters[0].Values[0]",L"string");    CkJsonObjectW_UpdateInt(json,L"IncludePlannedDeletion",123);    CkJsonObjectW_UpdateInt(json,L"MaxResults",123);    CkJsonObjectW_UpdateString(json,L"NextToken",L"string");    CkJsonObjectW_UpdateString(json,L"SortOrder",L"string");    CkRestW_AddHeader(rest,L"Content-Type",L"application/x-amz-json-1.1");    CkRestW_AddHeader(rest,L"X-Amz-Target",L"secretsmanager.ListSecrets");    CkJsonObjectW_EmitSb(json,sbRequestBody);    success = CkRestW_FullRequestSb(rest,L"POST",L"/",sbRequestBody,sbResponseBody);    CkJsonObjectW_LoadSb(jResp,sbResponseBody);    CkJsonObjectW_putI(jResp,i);    ARN = CkJsonObjectW_stringOf(jResp,L"SecretList[i].ARN");    CreatedDate = CkJsonObjectW_IntOf(jResp,L"SecretList[i].CreatedDate");    DeletedDate = CkJsonObjectW_IntOf(jResp,L"SecretList[i].DeletedDate");    Description = CkJsonObjectW_stringOf(jResp,L"SecretList[i].Description");    KmsKeyId = CkJsonObjectW_stringOf(jResp,L"SecretList[i].KmsKeyId");    LastAccessedDate = CkJsonObjectW_IntOf(jResp,L"SecretList[i].LastAccessedDate");    LastChangedDate = CkJsonObjectW_IntOf(jResp,L"SecretList[i].LastChangedDate");    LastRotatedDate = CkJsonObjectW_IntOf(jResp,L"SecretList[i].LastRotatedDate");    Name = CkJsonObjectW_stringOf(jResp,L"SecretList[i].Name");    NextRotationDate = CkJsonObjectW_IntOf(jResp,L"SecretList[i].NextRotationDate");    OwningService = CkJsonObjectW_stringOf(jResp,L"SecretList[i].OwningService");    PrimaryRegion = CkJsonObjectW_stringOf(jResp,L"SecretList[i].PrimaryRegion");    RotationEnabled = CkJsonObjectW_IntOf(jResp,L"SecretList[i].RotationEnabled");    RotationLambdaARN = CkJsonObjectW_stringOf(jResp,L"SecretList[i].RotationLambdaARN");    AutomaticallyAfterDays = CkJsonObjectW_IntOf(jResp,L"SecretList[i].RotationRules.AutomaticallyAfterDays");    Duration = CkJsonObjectW_stringOf(jResp,L"SecretList[i].RotationRules.Duration");    ScheduleExpression = CkJsonObjectW_stringOf(jResp,L"SecretList[i].RotationRules.ScheduleExpression");    j = 0;    count_j = CkJsonObjectW_SizeOfArray(jResp,L"SecretList[i].SecretVersionsToStages.string");    CkJsonObjectW_putJ(jResp,j);    strVal = CkJsonObjectW_stringOf(jResp,L"SecretList[i].SecretVersionsToStages.string[j]");    j = j + 1;    j = 0;    count_j = CkJsonObjectW_SizeOfArray(jResp,L"SecretList[i].Tags");    CkJsonObjectW_putJ(jResp,j);    Key = CkJsonObjectW_stringOf(jResp,L"SecretList[i].Tags[j].Key");    Value = CkJsonObjectW_stringOf(jResp,L"SecretList[i].Tags[j].Value");    j = j + 1;    i = i + 1;


    }