/// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            ListAppsResponse response = new ListAppsResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("appSummaries", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <AppSummary, AppSummaryUnmarshaller>(AppSummaryUnmarshaller.Instance);
                    response.AppSummaries = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("nextToken", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.NextToken = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Ejemplo n.º 2
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonSageMakerConfig config = new AmazonSageMakerConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonSageMakerClient client = new AmazonSageMakerClient(creds, config);

            ListAppsResponse resp = new ListAppsResponse();

            do
            {
                ListAppsRequest req = new ListAppsRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

                resp = client.ListApps(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.Apps)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        public static ListAppsResponse Unmarshall(UnmarshallerContext _ctx)
        {
            ListAppsResponse listAppsResponse = new ListAppsResponse();

            listAppsResponse.HttpResponse = _ctx.HttpResponse;
            listAppsResponse.Code         = _ctx.StringValue("ListApps.Code");
            listAppsResponse.Message      = _ctx.StringValue("ListApps.Message");
            listAppsResponse.RequestId    = _ctx.StringValue("ListApps.RequestId");

            ListAppsResponse.ListApps_Data data = new ListAppsResponse.ListApps_Data();
            data.TotalElements = _ctx.LongValue("ListApps.Data.TotalElements");
            data.TotalPages    = _ctx.IntegerValue("ListApps.Data.TotalPages");

            List <ListAppsResponse.ListApps_Data.ListApps_ItemsItem> data_items = new List <ListAppsResponse.ListApps_Data.ListApps_ItemsItem>();

            for (int i = 0; i < _ctx.Length("ListApps.Data.Items.Length"); i++)
            {
                ListAppsResponse.ListApps_Data.ListApps_ItemsItem itemsItem = new ListAppsResponse.ListApps_Data.ListApps_ItemsItem();
                itemsItem.CreatedAt      = _ctx.StringValue("ListApps.Data.Items[" + i + "].CreatedAt");
                itemsItem.DepartmentId   = _ctx.StringValue("ListApps.Data.Items[" + i + "].DepartmentId");
                itemsItem.DepartmentName = _ctx.StringValue("ListApps.Data.Items[" + i + "].DepartmentName");
                itemsItem.Disabled       = _ctx.BooleanValue("ListApps.Data.Items[" + i + "].Disabled");
                itemsItem.Id             = _ctx.StringValue("ListApps.Data.Items[" + i + "].Id");
                itemsItem.Name           = _ctx.StringValue("ListApps.Data.Items[" + i + "].Name");
                itemsItem.PackageName    = _ctx.StringValue("ListApps.Data.Items[" + i + "].PackageName");

                data_items.Add(itemsItem);
            }
            data.Items            = data_items;
            listAppsResponse.Data = data;

            return(listAppsResponse);
        }
Ejemplo n.º 4
0
        public static ListAppsResponse Unmarshall(UnmarshallerContext _ctx)
        {
            ListAppsResponse listAppsResponse = new ListAppsResponse();

            listAppsResponse.HttpResponse = _ctx.HttpResponse;

            return(listAppsResponse);
        }
        public static ListAppsResponse Unmarshall(UnmarshallerContext context)
        {
            ListAppsResponse listAppsResponse = new ListAppsResponse()
            {
                HttpResponse = context.HttpResponse,
                RequestId    = context.StringValue("ListApps.RequestId")
            };
            List <ListAppsResponse.AppInfo> appInfos = new List <ListAppsResponse.AppInfo>();

            for (int i = 0; i < context.Length("ListApps.AppInfos.Length"); i++)
            {
                ListAppsResponse.AppInfo appInfo = new ListAppsResponse.AppInfo()
                {
                    AppId         = context.StringValue($"ListApps.AppInfos[{i}].AppId"),
                    AppKey        = context.LongValue($"ListApps.AppInfos[{i}].AppKey"),
                    AppName       = context.StringValue($"ListApps.AppInfos[{i}].AppName"),
                    Description   = context.StringValue($"ListApps.AppInfos[{i}].Description"),
                    IndustryId    = context.IntegerValue($"ListApps.AppInfos[{i}].IndustryId"),
                    AndroidStatus = context.IntegerValue($"ListApps.AppInfos[{i}].AndroidStatus"),
                    IosStatus     = context.IntegerValue($"ListApps.AppInfos[{i}].IOSStatus"),
                    DeviceCount   = context.LongValue($"ListApps.AppInfos[{i}].DeviceCount"),
                    AppStatus     = context.IntegerValue($"ListApps.AppInfos[{i}].AppStatus"),
                    Status        = context.IntegerValue($"ListApps.AppInfos[{i}].Status"),
                    PushAppId     = context.StringValue($"ListApps.AppInfos[{i}].PushAppId"),
                    Source        = context.StringValue($"ListApps.AppInfos[{i}].Source")
                };
                ListAppsResponse.AppInfo.Extension_ extension = new ListAppsResponse.AppInfo.Extension_()
                {
                    XmAppSecretKey = context.StringValue($"ListApps.AppInfos[{i}].Extension.XmAppSecretKey"),
                    HwAppKey       = context.LongValue($"ListApps.AppInfos[{i}].Extension.HwAppKey"),
                    HwAppSecretKey = context.StringValue($"ListApps.AppInfos[{i}].Extension.HwAppSecretKey")
                };
                appInfo.Extension = extension;

                appInfos.Add(appInfo);
            }
            listAppsResponse.AppInfos = appInfos;

            return(listAppsResponse);
        }