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-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.Amplify.Model
{
/// <summary>
/// Container for the parameters to the UpdateWebhook operation.
/// Updates a webhook.
/// </summary>
public partial class UpdateWebhookRequest : AmazonAmplifyRequest
{
private string _branchName;
private string _description;
private string _webhookId;
/// <summary>
/// Gets and sets the property BranchName.
/// <para>
/// The name for a branch that is part of an Amplify app.
/// </para>
/// </summary>
[AWSProperty(Min=1, Max=255)]
public string BranchName
{
get { return this._branchName; }
set { this._branchName = value; }
}
// Check to see if BranchName property is set
internal bool IsSetBranchName()
{
return this._branchName != null;
}
/// <summary>
/// Gets and sets the property Description.
/// <para>
/// The description for a webhook.
/// </para>
/// </summary>
[AWSProperty(Max=1000)]
public string Description
{
get { return this._description; }
set { this._description = value; }
}
// Check to see if Description property is set
internal bool IsSetDescription()
{
return this._description != null;
}
/// <summary>
/// Gets and sets the property WebhookId.
/// <para>
/// The unique ID for a webhook.
/// </para>
/// </summary>
[AWSProperty(Required=true, Max=255)]
public string WebhookId
{
get { return this._webhookId; }
set { this._webhookId = value; }
}
// Check to see if WebhookId property is set
internal bool IsSetWebhookId()
{
return this._webhookId != null;
}
}
} | 99 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.Amplify.Model
{
/// <summary>
/// The result structure for the update webhook request.
/// </summary>
public partial class UpdateWebhookResponse : AmazonWebServiceResponse
{
private Webhook _webhook;
/// <summary>
/// Gets and sets the property Webhook.
/// <para>
/// Describes a webhook that connects repository events to an Amplify app.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public Webhook Webhook
{
get { return this._webhook; }
set { this._webhook = value; }
}
// Check to see if Webhook property is set
internal bool IsSetWebhook()
{
return this._webhook != null;
}
}
} | 58 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.Amplify.Model
{
/// <summary>
/// Describes a webhook that connects repository events to an Amplify app.
/// </summary>
public partial class Webhook
{
private string _branchName;
private DateTime? _createTime;
private string _description;
private DateTime? _updateTime;
private string _webhookArn;
private string _webhookId;
private string _webhookUrl;
/// <summary>
/// Gets and sets the property BranchName.
/// <para>
/// The name for a branch that is part of an Amplify app.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=255)]
public string BranchName
{
get { return this._branchName; }
set { this._branchName = value; }
}
// Check to see if BranchName property is set
internal bool IsSetBranchName()
{
return this._branchName != null;
}
/// <summary>
/// Gets and sets the property CreateTime.
/// <para>
/// The create date and time for a webhook.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime CreateTime
{
get { return this._createTime.GetValueOrDefault(); }
set { this._createTime = value; }
}
// Check to see if CreateTime property is set
internal bool IsSetCreateTime()
{
return this._createTime.HasValue;
}
/// <summary>
/// Gets and sets the property Description.
/// <para>
/// The description for a webhook.
/// </para>
/// </summary>
[AWSProperty(Required=true, Max=1000)]
public string Description
{
get { return this._description; }
set { this._description = value; }
}
// Check to see if Description property is set
internal bool IsSetDescription()
{
return this._description != null;
}
/// <summary>
/// Gets and sets the property UpdateTime.
/// <para>
/// Updates the date and time for a webhook.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime UpdateTime
{
get { return this._updateTime.GetValueOrDefault(); }
set { this._updateTime = value; }
}
// Check to see if UpdateTime property is set
internal bool IsSetUpdateTime()
{
return this._updateTime.HasValue;
}
/// <summary>
/// Gets and sets the property WebhookArn.
/// <para>
/// The Amazon Resource Name (ARN) for the webhook.
/// </para>
/// </summary>
[AWSProperty(Required=true, Max=1000)]
public string WebhookArn
{
get { return this._webhookArn; }
set { this._webhookArn = value; }
}
// Check to see if WebhookArn property is set
internal bool IsSetWebhookArn()
{
return this._webhookArn != null;
}
/// <summary>
/// Gets and sets the property WebhookId.
/// <para>
/// The ID of the webhook.
/// </para>
/// </summary>
[AWSProperty(Required=true, Max=255)]
public string WebhookId
{
get { return this._webhookId; }
set { this._webhookId = value; }
}
// Check to see if WebhookId property is set
internal bool IsSetWebhookId()
{
return this._webhookId != null;
}
/// <summary>
/// Gets and sets the property WebhookUrl.
/// <para>
/// The URL of the webhook.
/// </para>
/// </summary>
[AWSProperty(Required=true, Max=1000)]
public string WebhookUrl
{
get { return this._webhookUrl; }
set { this._webhookUrl = value; }
}
// Check to see if WebhookUrl property is set
internal bool IsSetWebhookUrl()
{
return this._webhookUrl != null;
}
}
} | 178 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for App Object
/// </summary>
public class AppUnmarshaller : IUnmarshaller<App, XmlUnmarshallerContext>, IUnmarshaller<App, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
App IUnmarshaller<App, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
{
throw new NotImplementedException();
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public App Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
App unmarshalledObject = new App();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("appArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.AppArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("appId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.AppId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("autoBranchCreationConfig", targetDepth))
{
var unmarshaller = AutoBranchCreationConfigUnmarshaller.Instance;
unmarshalledObject.AutoBranchCreationConfig = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("autoBranchCreationPatterns", targetDepth))
{
var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance);
unmarshalledObject.AutoBranchCreationPatterns = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("basicAuthCredentials", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BasicAuthCredentials = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("buildSpec", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BuildSpec = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("createTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.CreateTime = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("customHeaders", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.CustomHeaders = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("customRules", targetDepth))
{
var unmarshaller = new ListUnmarshaller<CustomRule, CustomRuleUnmarshaller>(CustomRuleUnmarshaller.Instance);
unmarshalledObject.CustomRules = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("defaultDomain", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DefaultDomain = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("description", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Description = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("enableAutoBranchCreation", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.EnableAutoBranchCreation = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("enableBasicAuth", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.EnableBasicAuth = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("enableBranchAutoBuild", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.EnableBranchAutoBuild = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("enableBranchAutoDeletion", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.EnableBranchAutoDeletion = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("environmentVariables", targetDepth))
{
var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance);
unmarshalledObject.EnvironmentVariables = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("iamServiceRoleArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.IamServiceRoleArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("name", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Name = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("platform", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Platform = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("productionBranch", targetDepth))
{
var unmarshaller = ProductionBranchUnmarshaller.Instance;
unmarshalledObject.ProductionBranch = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("repository", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Repository = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("repositoryCloneMethod", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.RepositoryCloneMethod = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("tags", targetDepth))
{
var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance);
unmarshalledObject.Tags = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("updateTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.UpdateTime = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static AppUnmarshaller _instance = new AppUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static AppUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 230 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for Artifact Object
/// </summary>
public class ArtifactUnmarshaller : IUnmarshaller<Artifact, XmlUnmarshallerContext>, IUnmarshaller<Artifact, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
Artifact IUnmarshaller<Artifact, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
{
throw new NotImplementedException();
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public Artifact Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
Artifact unmarshalledObject = new Artifact();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("artifactFileName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ArtifactFileName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("artifactId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ArtifactId = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static ArtifactUnmarshaller _instance = new ArtifactUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static ArtifactUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 98 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// AutoBranchCreationConfig Marshaller
/// </summary>
public class AutoBranchCreationConfigMarshaller : IRequestMarshaller<AutoBranchCreationConfig, JsonMarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="requestObject"></param>
/// <param name="context"></param>
/// <returns></returns>
public void Marshall(AutoBranchCreationConfig requestObject, JsonMarshallerContext context)
{
if(requestObject.IsSetBasicAuthCredentials())
{
context.Writer.WritePropertyName("basicAuthCredentials");
context.Writer.Write(requestObject.BasicAuthCredentials);
}
if(requestObject.IsSetBuildSpec())
{
context.Writer.WritePropertyName("buildSpec");
context.Writer.Write(requestObject.BuildSpec);
}
if(requestObject.IsSetEnableAutoBuild())
{
context.Writer.WritePropertyName("enableAutoBuild");
context.Writer.Write(requestObject.EnableAutoBuild);
}
if(requestObject.IsSetEnableBasicAuth())
{
context.Writer.WritePropertyName("enableBasicAuth");
context.Writer.Write(requestObject.EnableBasicAuth);
}
if(requestObject.IsSetEnablePerformanceMode())
{
context.Writer.WritePropertyName("enablePerformanceMode");
context.Writer.Write(requestObject.EnablePerformanceMode);
}
if(requestObject.IsSetEnablePullRequestPreview())
{
context.Writer.WritePropertyName("enablePullRequestPreview");
context.Writer.Write(requestObject.EnablePullRequestPreview);
}
if(requestObject.IsSetEnvironmentVariables())
{
context.Writer.WritePropertyName("environmentVariables");
context.Writer.WriteObjectStart();
foreach (var requestObjectEnvironmentVariablesKvp in requestObject.EnvironmentVariables)
{
context.Writer.WritePropertyName(requestObjectEnvironmentVariablesKvp.Key);
var requestObjectEnvironmentVariablesValue = requestObjectEnvironmentVariablesKvp.Value;
context.Writer.Write(requestObjectEnvironmentVariablesValue);
}
context.Writer.WriteObjectEnd();
}
if(requestObject.IsSetFramework())
{
context.Writer.WritePropertyName("framework");
context.Writer.Write(requestObject.Framework);
}
if(requestObject.IsSetPullRequestEnvironmentName())
{
context.Writer.WritePropertyName("pullRequestEnvironmentName");
context.Writer.Write(requestObject.PullRequestEnvironmentName);
}
if(requestObject.IsSetStage())
{
context.Writer.WritePropertyName("stage");
context.Writer.Write(requestObject.Stage);
}
}
/// <summary>
/// Singleton Marshaller.
/// </summary>
public readonly static AutoBranchCreationConfigMarshaller Instance = new AutoBranchCreationConfigMarshaller();
}
} | 124 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for AutoBranchCreationConfig Object
/// </summary>
public class AutoBranchCreationConfigUnmarshaller : IUnmarshaller<AutoBranchCreationConfig, XmlUnmarshallerContext>, IUnmarshaller<AutoBranchCreationConfig, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
AutoBranchCreationConfig IUnmarshaller<AutoBranchCreationConfig, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
{
throw new NotImplementedException();
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public AutoBranchCreationConfig Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
AutoBranchCreationConfig unmarshalledObject = new AutoBranchCreationConfig();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("basicAuthCredentials", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BasicAuthCredentials = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("buildSpec", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BuildSpec = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("enableAutoBuild", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.EnableAutoBuild = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("enableBasicAuth", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.EnableBasicAuth = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("enablePerformanceMode", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.EnablePerformanceMode = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("enablePullRequestPreview", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.EnablePullRequestPreview = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("environmentVariables", targetDepth))
{
var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance);
unmarshalledObject.EnvironmentVariables = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("framework", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Framework = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("pullRequestEnvironmentName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.PullRequestEnvironmentName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("stage", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Stage = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static AutoBranchCreationConfigUnmarshaller _instance = new AutoBranchCreationConfigUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static AutoBranchCreationConfigUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 146 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for BackendEnvironment Object
/// </summary>
public class BackendEnvironmentUnmarshaller : IUnmarshaller<BackendEnvironment, XmlUnmarshallerContext>, IUnmarshaller<BackendEnvironment, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
BackendEnvironment IUnmarshaller<BackendEnvironment, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
{
throw new NotImplementedException();
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public BackendEnvironment Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
BackendEnvironment unmarshalledObject = new BackendEnvironment();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("backendEnvironmentArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BackendEnvironmentArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("createTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.CreateTime = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("deploymentArtifacts", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DeploymentArtifacts = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("environmentName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.EnvironmentName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("stackName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.StackName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("updateTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.UpdateTime = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static BackendEnvironmentUnmarshaller _instance = new BackendEnvironmentUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static BackendEnvironmentUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 122 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for BadRequestException Object
/// </summary>
public class BadRequestExceptionUnmarshaller : IErrorResponseUnmarshaller<BadRequestException, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public BadRequestException Unmarshall(JsonUnmarshallerContext context)
{
return this.Unmarshall(context, new Amazon.Runtime.Internal.ErrorResponse());
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <param name="errorResponse"></param>
/// <returns></returns>
public BadRequestException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse)
{
context.Read();
BadRequestException unmarshalledObject = new BadRequestException(errorResponse.Message, errorResponse.InnerException,
errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
}
return unmarshalledObject;
}
private static BadRequestExceptionUnmarshaller _instance = new BadRequestExceptionUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static BadRequestExceptionUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 85 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for Branch Object
/// </summary>
public class BranchUnmarshaller : IUnmarshaller<Branch, XmlUnmarshallerContext>, IUnmarshaller<Branch, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
Branch IUnmarshaller<Branch, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
{
throw new NotImplementedException();
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public Branch Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
Branch unmarshalledObject = new Branch();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("activeJobId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ActiveJobId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("associatedResources", targetDepth))
{
var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance);
unmarshalledObject.AssociatedResources = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("backendEnvironmentArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BackendEnvironmentArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("basicAuthCredentials", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BasicAuthCredentials = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("branchArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BranchArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("branchName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BranchName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("buildSpec", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BuildSpec = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("createTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.CreateTime = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("customDomains", targetDepth))
{
var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance);
unmarshalledObject.CustomDomains = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("description", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Description = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("destinationBranch", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DestinationBranch = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("displayName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DisplayName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("enableAutoBuild", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.EnableAutoBuild = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("enableBasicAuth", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.EnableBasicAuth = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("enableNotification", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.EnableNotification = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("enablePerformanceMode", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.EnablePerformanceMode = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("enablePullRequestPreview", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.EnablePullRequestPreview = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("environmentVariables", targetDepth))
{
var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance);
unmarshalledObject.EnvironmentVariables = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("framework", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Framework = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("pullRequestEnvironmentName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.PullRequestEnvironmentName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("sourceBranch", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.SourceBranch = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("stage", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Stage = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("tags", targetDepth))
{
var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance);
unmarshalledObject.Tags = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("thumbnailUrl", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ThumbnailUrl = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("totalNumberOfJobs", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.TotalNumberOfJobs = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ttl", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Ttl = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("updateTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.UpdateTime = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static BranchUnmarshaller _instance = new BranchUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static BranchUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 248 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// CreateApp Request Marshaller
/// </summary>
public class CreateAppRequestMarshaller : IMarshaller<IRequest, CreateAppRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((CreateAppRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(CreateAppRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers["Content-Type"] = "application/json";
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "POST";
request.ResourcePath = "/apps";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetAccessToken())
{
context.Writer.WritePropertyName("accessToken");
context.Writer.Write(publicRequest.AccessToken);
}
if(publicRequest.IsSetAutoBranchCreationConfig())
{
context.Writer.WritePropertyName("autoBranchCreationConfig");
context.Writer.WriteObjectStart();
var marshaller = AutoBranchCreationConfigMarshaller.Instance;
marshaller.Marshall(publicRequest.AutoBranchCreationConfig, context);
context.Writer.WriteObjectEnd();
}
if(publicRequest.IsSetAutoBranchCreationPatterns())
{
context.Writer.WritePropertyName("autoBranchCreationPatterns");
context.Writer.WriteArrayStart();
foreach(var publicRequestAutoBranchCreationPatternsListValue in publicRequest.AutoBranchCreationPatterns)
{
context.Writer.Write(publicRequestAutoBranchCreationPatternsListValue);
}
context.Writer.WriteArrayEnd();
}
if(publicRequest.IsSetBasicAuthCredentials())
{
context.Writer.WritePropertyName("basicAuthCredentials");
context.Writer.Write(publicRequest.BasicAuthCredentials);
}
if(publicRequest.IsSetBuildSpec())
{
context.Writer.WritePropertyName("buildSpec");
context.Writer.Write(publicRequest.BuildSpec);
}
if(publicRequest.IsSetCustomHeaders())
{
context.Writer.WritePropertyName("customHeaders");
context.Writer.Write(publicRequest.CustomHeaders);
}
if(publicRequest.IsSetCustomRules())
{
context.Writer.WritePropertyName("customRules");
context.Writer.WriteArrayStart();
foreach(var publicRequestCustomRulesListValue in publicRequest.CustomRules)
{
context.Writer.WriteObjectStart();
var marshaller = CustomRuleMarshaller.Instance;
marshaller.Marshall(publicRequestCustomRulesListValue, context);
context.Writer.WriteObjectEnd();
}
context.Writer.WriteArrayEnd();
}
if(publicRequest.IsSetDescription())
{
context.Writer.WritePropertyName("description");
context.Writer.Write(publicRequest.Description);
}
if(publicRequest.IsSetEnableAutoBranchCreation())
{
context.Writer.WritePropertyName("enableAutoBranchCreation");
context.Writer.Write(publicRequest.EnableAutoBranchCreation);
}
if(publicRequest.IsSetEnableBasicAuth())
{
context.Writer.WritePropertyName("enableBasicAuth");
context.Writer.Write(publicRequest.EnableBasicAuth);
}
if(publicRequest.IsSetEnableBranchAutoBuild())
{
context.Writer.WritePropertyName("enableBranchAutoBuild");
context.Writer.Write(publicRequest.EnableBranchAutoBuild);
}
if(publicRequest.IsSetEnableBranchAutoDeletion())
{
context.Writer.WritePropertyName("enableBranchAutoDeletion");
context.Writer.Write(publicRequest.EnableBranchAutoDeletion);
}
if(publicRequest.IsSetEnvironmentVariables())
{
context.Writer.WritePropertyName("environmentVariables");
context.Writer.WriteObjectStart();
foreach (var publicRequestEnvironmentVariablesKvp in publicRequest.EnvironmentVariables)
{
context.Writer.WritePropertyName(publicRequestEnvironmentVariablesKvp.Key);
var publicRequestEnvironmentVariablesValue = publicRequestEnvironmentVariablesKvp.Value;
context.Writer.Write(publicRequestEnvironmentVariablesValue);
}
context.Writer.WriteObjectEnd();
}
if(publicRequest.IsSetIamServiceRoleArn())
{
context.Writer.WritePropertyName("iamServiceRoleArn");
context.Writer.Write(publicRequest.IamServiceRoleArn);
}
if(publicRequest.IsSetName())
{
context.Writer.WritePropertyName("name");
context.Writer.Write(publicRequest.Name);
}
if(publicRequest.IsSetOauthToken())
{
context.Writer.WritePropertyName("oauthToken");
context.Writer.Write(publicRequest.OauthToken);
}
if(publicRequest.IsSetPlatform())
{
context.Writer.WritePropertyName("platform");
context.Writer.Write(publicRequest.Platform);
}
if(publicRequest.IsSetRepository())
{
context.Writer.WritePropertyName("repository");
context.Writer.Write(publicRequest.Repository);
}
if(publicRequest.IsSetTags())
{
context.Writer.WritePropertyName("tags");
context.Writer.WriteObjectStart();
foreach (var publicRequestTagsKvp in publicRequest.Tags)
{
context.Writer.WritePropertyName(publicRequestTagsKvp.Key);
var publicRequestTagsValue = publicRequestTagsKvp.Value;
context.Writer.Write(publicRequestTagsValue);
}
context.Writer.WriteObjectEnd();
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static CreateAppRequestMarshaller _instance = new CreateAppRequestMarshaller();
internal static CreateAppRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static CreateAppRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 245 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for CreateApp operation
/// </summary>
public class CreateAppResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
CreateAppResponse response = new CreateAppResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("app", targetDepth))
{
var unmarshaller = AppUnmarshaller.Instance;
response.App = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("DependentServiceFailureException"))
{
return DependentServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("LimitExceededException"))
{
return LimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static CreateAppResponseUnmarshaller _instance = new CreateAppResponseUnmarshaller();
internal static CreateAppResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static CreateAppResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 126 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// CreateBackendEnvironment Request Marshaller
/// </summary>
public class CreateBackendEnvironmentRequestMarshaller : IMarshaller<IRequest, CreateBackendEnvironmentRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((CreateBackendEnvironmentRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(CreateBackendEnvironmentRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers["Content-Type"] = "application/json";
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "POST";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
request.ResourcePath = "/apps/{appId}/backendenvironments";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetDeploymentArtifacts())
{
context.Writer.WritePropertyName("deploymentArtifacts");
context.Writer.Write(publicRequest.DeploymentArtifacts);
}
if(publicRequest.IsSetEnvironmentName())
{
context.Writer.WritePropertyName("environmentName");
context.Writer.Write(publicRequest.EnvironmentName);
}
if(publicRequest.IsSetStackName())
{
context.Writer.WritePropertyName("stackName");
context.Writer.Write(publicRequest.StackName);
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static CreateBackendEnvironmentRequestMarshaller _instance = new CreateBackendEnvironmentRequestMarshaller();
internal static CreateBackendEnvironmentRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static CreateBackendEnvironmentRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 116 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for CreateBackendEnvironment operation
/// </summary>
public class CreateBackendEnvironmentResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
CreateBackendEnvironmentResponse response = new CreateBackendEnvironmentResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("backendEnvironment", targetDepth))
{
var unmarshaller = BackendEnvironmentUnmarshaller.Instance;
response.BackendEnvironment = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("LimitExceededException"))
{
return LimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static CreateBackendEnvironmentResponseUnmarshaller _instance = new CreateBackendEnvironmentResponseUnmarshaller();
internal static CreateBackendEnvironmentResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static CreateBackendEnvironmentResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 126 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// CreateBranch Request Marshaller
/// </summary>
public class CreateBranchRequestMarshaller : IMarshaller<IRequest, CreateBranchRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((CreateBranchRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(CreateBranchRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers["Content-Type"] = "application/json";
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "POST";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
request.ResourcePath = "/apps/{appId}/branches";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetBackendEnvironmentArn())
{
context.Writer.WritePropertyName("backendEnvironmentArn");
context.Writer.Write(publicRequest.BackendEnvironmentArn);
}
if(publicRequest.IsSetBasicAuthCredentials())
{
context.Writer.WritePropertyName("basicAuthCredentials");
context.Writer.Write(publicRequest.BasicAuthCredentials);
}
if(publicRequest.IsSetBranchName())
{
context.Writer.WritePropertyName("branchName");
context.Writer.Write(publicRequest.BranchName);
}
if(publicRequest.IsSetBuildSpec())
{
context.Writer.WritePropertyName("buildSpec");
context.Writer.Write(publicRequest.BuildSpec);
}
if(publicRequest.IsSetDescription())
{
context.Writer.WritePropertyName("description");
context.Writer.Write(publicRequest.Description);
}
if(publicRequest.IsSetDisplayName())
{
context.Writer.WritePropertyName("displayName");
context.Writer.Write(publicRequest.DisplayName);
}
if(publicRequest.IsSetEnableAutoBuild())
{
context.Writer.WritePropertyName("enableAutoBuild");
context.Writer.Write(publicRequest.EnableAutoBuild);
}
if(publicRequest.IsSetEnableBasicAuth())
{
context.Writer.WritePropertyName("enableBasicAuth");
context.Writer.Write(publicRequest.EnableBasicAuth);
}
if(publicRequest.IsSetEnableNotification())
{
context.Writer.WritePropertyName("enableNotification");
context.Writer.Write(publicRequest.EnableNotification);
}
if(publicRequest.IsSetEnablePerformanceMode())
{
context.Writer.WritePropertyName("enablePerformanceMode");
context.Writer.Write(publicRequest.EnablePerformanceMode);
}
if(publicRequest.IsSetEnablePullRequestPreview())
{
context.Writer.WritePropertyName("enablePullRequestPreview");
context.Writer.Write(publicRequest.EnablePullRequestPreview);
}
if(publicRequest.IsSetEnvironmentVariables())
{
context.Writer.WritePropertyName("environmentVariables");
context.Writer.WriteObjectStart();
foreach (var publicRequestEnvironmentVariablesKvp in publicRequest.EnvironmentVariables)
{
context.Writer.WritePropertyName(publicRequestEnvironmentVariablesKvp.Key);
var publicRequestEnvironmentVariablesValue = publicRequestEnvironmentVariablesKvp.Value;
context.Writer.Write(publicRequestEnvironmentVariablesValue);
}
context.Writer.WriteObjectEnd();
}
if(publicRequest.IsSetFramework())
{
context.Writer.WritePropertyName("framework");
context.Writer.Write(publicRequest.Framework);
}
if(publicRequest.IsSetPullRequestEnvironmentName())
{
context.Writer.WritePropertyName("pullRequestEnvironmentName");
context.Writer.Write(publicRequest.PullRequestEnvironmentName);
}
if(publicRequest.IsSetStage())
{
context.Writer.WritePropertyName("stage");
context.Writer.Write(publicRequest.Stage);
}
if(publicRequest.IsSetTags())
{
context.Writer.WritePropertyName("tags");
context.Writer.WriteObjectStart();
foreach (var publicRequestTagsKvp in publicRequest.Tags)
{
context.Writer.WritePropertyName(publicRequestTagsKvp.Key);
var publicRequestTagsValue = publicRequestTagsKvp.Value;
context.Writer.Write(publicRequestTagsValue);
}
context.Writer.WriteObjectEnd();
}
if(publicRequest.IsSetTtl())
{
context.Writer.WritePropertyName("ttl");
context.Writer.Write(publicRequest.Ttl);
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static CreateBranchRequestMarshaller _instance = new CreateBranchRequestMarshaller();
internal static CreateBranchRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static CreateBranchRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 216 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for CreateBranch operation
/// </summary>
public class CreateBranchResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
CreateBranchResponse response = new CreateBranchResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("branch", targetDepth))
{
var unmarshaller = BranchUnmarshaller.Instance;
response.Branch = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("DependentServiceFailureException"))
{
return DependentServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("LimitExceededException"))
{
return LimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static CreateBranchResponseUnmarshaller _instance = new CreateBranchResponseUnmarshaller();
internal static CreateBranchResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static CreateBranchResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 130 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// CreateDeployment Request Marshaller
/// </summary>
public class CreateDeploymentRequestMarshaller : IMarshaller<IRequest, CreateDeploymentRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((CreateDeploymentRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(CreateDeploymentRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers["Content-Type"] = "application/json";
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "POST";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (!publicRequest.IsSetBranchName())
throw new AmazonAmplifyException("Request object does not have required field BranchName set");
request.AddPathResource("{branchName}", StringUtils.FromString(publicRequest.BranchName));
request.ResourcePath = "/apps/{appId}/branches/{branchName}/deployments";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetFileMap())
{
context.Writer.WritePropertyName("fileMap");
context.Writer.WriteObjectStart();
foreach (var publicRequestFileMapKvp in publicRequest.FileMap)
{
context.Writer.WritePropertyName(publicRequestFileMapKvp.Key);
var publicRequestFileMapValue = publicRequestFileMapKvp.Value;
context.Writer.Write(publicRequestFileMapValue);
}
context.Writer.WriteObjectEnd();
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static CreateDeploymentRequestMarshaller _instance = new CreateDeploymentRequestMarshaller();
internal static CreateDeploymentRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static CreateDeploymentRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 115 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for CreateDeployment operation
/// </summary>
public class CreateDeploymentResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
CreateDeploymentResponse response = new CreateDeploymentResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("fileUploadUrls", targetDepth))
{
var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance);
response.FileUploadUrls = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("jobId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.JobId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("zipUploadUrl", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.ZipUploadUrl = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("LimitExceededException"))
{
return LimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static CreateDeploymentResponseUnmarshaller _instance = new CreateDeploymentResponseUnmarshaller();
internal static CreateDeploymentResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static CreateDeploymentResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 134 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// CreateDomainAssociation Request Marshaller
/// </summary>
public class CreateDomainAssociationRequestMarshaller : IMarshaller<IRequest, CreateDomainAssociationRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((CreateDomainAssociationRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(CreateDomainAssociationRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers["Content-Type"] = "application/json";
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "POST";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
request.ResourcePath = "/apps/{appId}/domains";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetAutoSubDomainCreationPatterns())
{
context.Writer.WritePropertyName("autoSubDomainCreationPatterns");
context.Writer.WriteArrayStart();
foreach(var publicRequestAutoSubDomainCreationPatternsListValue in publicRequest.AutoSubDomainCreationPatterns)
{
context.Writer.Write(publicRequestAutoSubDomainCreationPatternsListValue);
}
context.Writer.WriteArrayEnd();
}
if(publicRequest.IsSetAutoSubDomainIAMRole())
{
context.Writer.WritePropertyName("autoSubDomainIAMRole");
context.Writer.Write(publicRequest.AutoSubDomainIAMRole);
}
if(publicRequest.IsSetDomainName())
{
context.Writer.WritePropertyName("domainName");
context.Writer.Write(publicRequest.DomainName);
}
if(publicRequest.IsSetEnableAutoSubDomain())
{
context.Writer.WritePropertyName("enableAutoSubDomain");
context.Writer.Write(publicRequest.EnableAutoSubDomain);
}
if(publicRequest.IsSetSubDomainSettings())
{
context.Writer.WritePropertyName("subDomainSettings");
context.Writer.WriteArrayStart();
foreach(var publicRequestSubDomainSettingsListValue in publicRequest.SubDomainSettings)
{
context.Writer.WriteObjectStart();
var marshaller = SubDomainSettingMarshaller.Instance;
marshaller.Marshall(publicRequestSubDomainSettingsListValue, context);
context.Writer.WriteObjectEnd();
}
context.Writer.WriteArrayEnd();
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static CreateDomainAssociationRequestMarshaller _instance = new CreateDomainAssociationRequestMarshaller();
internal static CreateDomainAssociationRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static CreateDomainAssociationRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 143 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for CreateDomainAssociation operation
/// </summary>
public class CreateDomainAssociationResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
CreateDomainAssociationResponse response = new CreateDomainAssociationResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("domainAssociation", targetDepth))
{
var unmarshaller = DomainAssociationUnmarshaller.Instance;
response.DomainAssociation = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("DependentServiceFailureException"))
{
return DependentServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("LimitExceededException"))
{
return LimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static CreateDomainAssociationResponseUnmarshaller _instance = new CreateDomainAssociationResponseUnmarshaller();
internal static CreateDomainAssociationResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static CreateDomainAssociationResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 130 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// CreateWebhook Request Marshaller
/// </summary>
public class CreateWebhookRequestMarshaller : IMarshaller<IRequest, CreateWebhookRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((CreateWebhookRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(CreateWebhookRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers["Content-Type"] = "application/json";
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "POST";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
request.ResourcePath = "/apps/{appId}/webhooks";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetBranchName())
{
context.Writer.WritePropertyName("branchName");
context.Writer.Write(publicRequest.BranchName);
}
if(publicRequest.IsSetDescription())
{
context.Writer.WritePropertyName("description");
context.Writer.Write(publicRequest.Description);
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static CreateWebhookRequestMarshaller _instance = new CreateWebhookRequestMarshaller();
internal static CreateWebhookRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static CreateWebhookRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 110 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for CreateWebhook operation
/// </summary>
public class CreateWebhookResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
CreateWebhookResponse response = new CreateWebhookResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("webhook", targetDepth))
{
var unmarshaller = WebhookUnmarshaller.Instance;
response.Webhook = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("DependentServiceFailureException"))
{
return DependentServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("LimitExceededException"))
{
return LimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static CreateWebhookResponseUnmarshaller _instance = new CreateWebhookResponseUnmarshaller();
internal static CreateWebhookResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static CreateWebhookResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 130 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// CustomRule Marshaller
/// </summary>
public class CustomRuleMarshaller : IRequestMarshaller<CustomRule, JsonMarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="requestObject"></param>
/// <param name="context"></param>
/// <returns></returns>
public void Marshall(CustomRule requestObject, JsonMarshallerContext context)
{
if(requestObject.IsSetCondition())
{
context.Writer.WritePropertyName("condition");
context.Writer.Write(requestObject.Condition);
}
if(requestObject.IsSetSource())
{
context.Writer.WritePropertyName("source");
context.Writer.Write(requestObject.Source);
}
if(requestObject.IsSetStatus())
{
context.Writer.WritePropertyName("status");
context.Writer.Write(requestObject.Status);
}
if(requestObject.IsSetTarget())
{
context.Writer.WritePropertyName("target");
context.Writer.Write(requestObject.Target);
}
}
/// <summary>
/// Singleton Marshaller.
/// </summary>
public readonly static CustomRuleMarshaller Instance = new CustomRuleMarshaller();
}
} | 80 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for CustomRule Object
/// </summary>
public class CustomRuleUnmarshaller : IUnmarshaller<CustomRule, XmlUnmarshallerContext>, IUnmarshaller<CustomRule, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
CustomRule IUnmarshaller<CustomRule, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
{
throw new NotImplementedException();
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public CustomRule Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
CustomRule unmarshalledObject = new CustomRule();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("condition", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Condition = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("source", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Source = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("status", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Status = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("target", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Target = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static CustomRuleUnmarshaller _instance = new CustomRuleUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static CustomRuleUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 110 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// DeleteApp Request Marshaller
/// </summary>
public class DeleteAppRequestMarshaller : IMarshaller<IRequest, DeleteAppRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((DeleteAppRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(DeleteAppRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "DELETE";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
request.ResourcePath = "/apps/{appId}";
return request;
}
private static DeleteAppRequestMarshaller _instance = new DeleteAppRequestMarshaller();
internal static DeleteAppRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static DeleteAppRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 87 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for DeleteApp operation
/// </summary>
public class DeleteAppResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
DeleteAppResponse response = new DeleteAppResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("app", targetDepth))
{
var unmarshaller = AppUnmarshaller.Instance;
response.App = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("DependentServiceFailureException"))
{
return DependentServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static DeleteAppResponseUnmarshaller _instance = new DeleteAppResponseUnmarshaller();
internal static DeleteAppResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static DeleteAppResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 126 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// DeleteBackendEnvironment Request Marshaller
/// </summary>
public class DeleteBackendEnvironmentRequestMarshaller : IMarshaller<IRequest, DeleteBackendEnvironmentRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((DeleteBackendEnvironmentRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(DeleteBackendEnvironmentRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "DELETE";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (!publicRequest.IsSetEnvironmentName())
throw new AmazonAmplifyException("Request object does not have required field EnvironmentName set");
request.AddPathResource("{environmentName}", StringUtils.FromString(publicRequest.EnvironmentName));
request.ResourcePath = "/apps/{appId}/backendenvironments/{environmentName}";
return request;
}
private static DeleteBackendEnvironmentRequestMarshaller _instance = new DeleteBackendEnvironmentRequestMarshaller();
internal static DeleteBackendEnvironmentRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static DeleteBackendEnvironmentRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 90 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for DeleteBackendEnvironment operation
/// </summary>
public class DeleteBackendEnvironmentResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
DeleteBackendEnvironmentResponse response = new DeleteBackendEnvironmentResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("backendEnvironment", targetDepth))
{
var unmarshaller = BackendEnvironmentUnmarshaller.Instance;
response.BackendEnvironment = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("DependentServiceFailureException"))
{
return DependentServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static DeleteBackendEnvironmentResponseUnmarshaller _instance = new DeleteBackendEnvironmentResponseUnmarshaller();
internal static DeleteBackendEnvironmentResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static DeleteBackendEnvironmentResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 126 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// DeleteBranch Request Marshaller
/// </summary>
public class DeleteBranchRequestMarshaller : IMarshaller<IRequest, DeleteBranchRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((DeleteBranchRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(DeleteBranchRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "DELETE";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (!publicRequest.IsSetBranchName())
throw new AmazonAmplifyException("Request object does not have required field BranchName set");
request.AddPathResource("{branchName}", StringUtils.FromString(publicRequest.BranchName));
request.ResourcePath = "/apps/{appId}/branches/{branchName}";
return request;
}
private static DeleteBranchRequestMarshaller _instance = new DeleteBranchRequestMarshaller();
internal static DeleteBranchRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static DeleteBranchRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 90 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for DeleteBranch operation
/// </summary>
public class DeleteBranchResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
DeleteBranchResponse response = new DeleteBranchResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("branch", targetDepth))
{
var unmarshaller = BranchUnmarshaller.Instance;
response.Branch = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("DependentServiceFailureException"))
{
return DependentServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static DeleteBranchResponseUnmarshaller _instance = new DeleteBranchResponseUnmarshaller();
internal static DeleteBranchResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static DeleteBranchResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 126 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// DeleteDomainAssociation Request Marshaller
/// </summary>
public class DeleteDomainAssociationRequestMarshaller : IMarshaller<IRequest, DeleteDomainAssociationRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((DeleteDomainAssociationRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(DeleteDomainAssociationRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "DELETE";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (!publicRequest.IsSetDomainName())
throw new AmazonAmplifyException("Request object does not have required field DomainName set");
request.AddPathResource("{domainName}", StringUtils.FromString(publicRequest.DomainName));
request.ResourcePath = "/apps/{appId}/domains/{domainName}";
return request;
}
private static DeleteDomainAssociationRequestMarshaller _instance = new DeleteDomainAssociationRequestMarshaller();
internal static DeleteDomainAssociationRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static DeleteDomainAssociationRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 90 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for DeleteDomainAssociation operation
/// </summary>
public class DeleteDomainAssociationResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
DeleteDomainAssociationResponse response = new DeleteDomainAssociationResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("domainAssociation", targetDepth))
{
var unmarshaller = DomainAssociationUnmarshaller.Instance;
response.DomainAssociation = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("DependentServiceFailureException"))
{
return DependentServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static DeleteDomainAssociationResponseUnmarshaller _instance = new DeleteDomainAssociationResponseUnmarshaller();
internal static DeleteDomainAssociationResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static DeleteDomainAssociationResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 126 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// DeleteJob Request Marshaller
/// </summary>
public class DeleteJobRequestMarshaller : IMarshaller<IRequest, DeleteJobRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((DeleteJobRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(DeleteJobRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "DELETE";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (!publicRequest.IsSetBranchName())
throw new AmazonAmplifyException("Request object does not have required field BranchName set");
request.AddPathResource("{branchName}", StringUtils.FromString(publicRequest.BranchName));
if (!publicRequest.IsSetJobId())
throw new AmazonAmplifyException("Request object does not have required field JobId set");
request.AddPathResource("{jobId}", StringUtils.FromString(publicRequest.JobId));
request.ResourcePath = "/apps/{appId}/branches/{branchName}/jobs/{jobId}";
return request;
}
private static DeleteJobRequestMarshaller _instance = new DeleteJobRequestMarshaller();
internal static DeleteJobRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static DeleteJobRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 93 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for DeleteJob operation
/// </summary>
public class DeleteJobResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
DeleteJobResponse response = new DeleteJobResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("jobSummary", targetDepth))
{
var unmarshaller = JobSummaryUnmarshaller.Instance;
response.JobSummary = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("LimitExceededException"))
{
return LimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static DeleteJobResponseUnmarshaller _instance = new DeleteJobResponseUnmarshaller();
internal static DeleteJobResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static DeleteJobResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 126 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// DeleteWebhook Request Marshaller
/// </summary>
public class DeleteWebhookRequestMarshaller : IMarshaller<IRequest, DeleteWebhookRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((DeleteWebhookRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(DeleteWebhookRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "DELETE";
if (!publicRequest.IsSetWebhookId())
throw new AmazonAmplifyException("Request object does not have required field WebhookId set");
request.AddPathResource("{webhookId}", StringUtils.FromString(publicRequest.WebhookId));
request.ResourcePath = "/webhooks/{webhookId}";
return request;
}
private static DeleteWebhookRequestMarshaller _instance = new DeleteWebhookRequestMarshaller();
internal static DeleteWebhookRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static DeleteWebhookRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 87 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for DeleteWebhook operation
/// </summary>
public class DeleteWebhookResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
DeleteWebhookResponse response = new DeleteWebhookResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("webhook", targetDepth))
{
var unmarshaller = WebhookUnmarshaller.Instance;
response.Webhook = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("LimitExceededException"))
{
return LimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static DeleteWebhookResponseUnmarshaller _instance = new DeleteWebhookResponseUnmarshaller();
internal static DeleteWebhookResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static DeleteWebhookResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 126 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for DependentServiceFailureException Object
/// </summary>
public class DependentServiceFailureExceptionUnmarshaller : IErrorResponseUnmarshaller<DependentServiceFailureException, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public DependentServiceFailureException Unmarshall(JsonUnmarshallerContext context)
{
return this.Unmarshall(context, new Amazon.Runtime.Internal.ErrorResponse());
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <param name="errorResponse"></param>
/// <returns></returns>
public DependentServiceFailureException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse)
{
context.Read();
DependentServiceFailureException unmarshalledObject = new DependentServiceFailureException(errorResponse.Message, errorResponse.InnerException,
errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
}
return unmarshalledObject;
}
private static DependentServiceFailureExceptionUnmarshaller _instance = new DependentServiceFailureExceptionUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static DependentServiceFailureExceptionUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 85 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for DomainAssociation Object
/// </summary>
public class DomainAssociationUnmarshaller : IUnmarshaller<DomainAssociation, XmlUnmarshallerContext>, IUnmarshaller<DomainAssociation, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
DomainAssociation IUnmarshaller<DomainAssociation, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
{
throw new NotImplementedException();
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public DomainAssociation Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
DomainAssociation unmarshalledObject = new DomainAssociation();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("autoSubDomainCreationPatterns", targetDepth))
{
var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance);
unmarshalledObject.AutoSubDomainCreationPatterns = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("autoSubDomainIAMRole", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.AutoSubDomainIAMRole = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("certificateVerificationDNSRecord", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.CertificateVerificationDNSRecord = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("domainAssociationArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DomainAssociationArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("domainName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DomainName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("domainStatus", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DomainStatus = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("enableAutoSubDomain", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.EnableAutoSubDomain = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("statusReason", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.StatusReason = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("subDomains", targetDepth))
{
var unmarshaller = new ListUnmarshaller<SubDomain, SubDomainUnmarshaller>(SubDomainUnmarshaller.Instance);
unmarshalledObject.SubDomains = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static DomainAssociationUnmarshaller _instance = new DomainAssociationUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static DomainAssociationUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 140 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// GenerateAccessLogs Request Marshaller
/// </summary>
public class GenerateAccessLogsRequestMarshaller : IMarshaller<IRequest, GenerateAccessLogsRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((GenerateAccessLogsRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(GenerateAccessLogsRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers["Content-Type"] = "application/json";
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "POST";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
request.ResourcePath = "/apps/{appId}/accesslogs";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetDomainName())
{
context.Writer.WritePropertyName("domainName");
context.Writer.Write(publicRequest.DomainName);
}
if(publicRequest.IsSetEndTime())
{
context.Writer.WritePropertyName("endTime");
context.Writer.Write(publicRequest.EndTime);
}
if(publicRequest.IsSetStartTime())
{
context.Writer.WritePropertyName("startTime");
context.Writer.Write(publicRequest.StartTime);
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static GenerateAccessLogsRequestMarshaller _instance = new GenerateAccessLogsRequestMarshaller();
internal static GenerateAccessLogsRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static GenerateAccessLogsRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 116 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for GenerateAccessLogs operation
/// </summary>
public class GenerateAccessLogsResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
GenerateAccessLogsResponse response = new GenerateAccessLogsResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("logUrl", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.LogUrl = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static GenerateAccessLogsResponseUnmarshaller _instance = new GenerateAccessLogsResponseUnmarshaller();
internal static GenerateAccessLogsResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static GenerateAccessLogsResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 122 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// GetApp Request Marshaller
/// </summary>
public class GetAppRequestMarshaller : IMarshaller<IRequest, GetAppRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((GetAppRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(GetAppRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "GET";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
request.ResourcePath = "/apps/{appId}";
return request;
}
private static GetAppRequestMarshaller _instance = new GetAppRequestMarshaller();
internal static GetAppRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static GetAppRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 87 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for GetApp operation
/// </summary>
public class GetAppResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
GetAppResponse response = new GetAppResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("app", targetDepth))
{
var unmarshaller = AppUnmarshaller.Instance;
response.App = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static GetAppResponseUnmarshaller _instance = new GetAppResponseUnmarshaller();
internal static GetAppResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static GetAppResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 122 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// GetArtifactUrl Request Marshaller
/// </summary>
public class GetArtifactUrlRequestMarshaller : IMarshaller<IRequest, GetArtifactUrlRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((GetArtifactUrlRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(GetArtifactUrlRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "GET";
if (!publicRequest.IsSetArtifactId())
throw new AmazonAmplifyException("Request object does not have required field ArtifactId set");
request.AddPathResource("{artifactId}", StringUtils.FromString(publicRequest.ArtifactId));
request.ResourcePath = "/artifacts/{artifactId}";
return request;
}
private static GetArtifactUrlRequestMarshaller _instance = new GetArtifactUrlRequestMarshaller();
internal static GetArtifactUrlRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static GetArtifactUrlRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 87 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for GetArtifactUrl operation
/// </summary>
public class GetArtifactUrlResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
GetArtifactUrlResponse response = new GetArtifactUrlResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("artifactId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.ArtifactId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("artifactUrl", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.ArtifactUrl = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("LimitExceededException"))
{
return LimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static GetArtifactUrlResponseUnmarshaller _instance = new GetArtifactUrlResponseUnmarshaller();
internal static GetArtifactUrlResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static GetArtifactUrlResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 132 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// GetBackendEnvironment Request Marshaller
/// </summary>
public class GetBackendEnvironmentRequestMarshaller : IMarshaller<IRequest, GetBackendEnvironmentRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((GetBackendEnvironmentRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(GetBackendEnvironmentRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "GET";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (!publicRequest.IsSetEnvironmentName())
throw new AmazonAmplifyException("Request object does not have required field EnvironmentName set");
request.AddPathResource("{environmentName}", StringUtils.FromString(publicRequest.EnvironmentName));
request.ResourcePath = "/apps/{appId}/backendenvironments/{environmentName}";
return request;
}
private static GetBackendEnvironmentRequestMarshaller _instance = new GetBackendEnvironmentRequestMarshaller();
internal static GetBackendEnvironmentRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static GetBackendEnvironmentRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 90 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for GetBackendEnvironment operation
/// </summary>
public class GetBackendEnvironmentResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
GetBackendEnvironmentResponse response = new GetBackendEnvironmentResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("backendEnvironment", targetDepth))
{
var unmarshaller = BackendEnvironmentUnmarshaller.Instance;
response.BackendEnvironment = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static GetBackendEnvironmentResponseUnmarshaller _instance = new GetBackendEnvironmentResponseUnmarshaller();
internal static GetBackendEnvironmentResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static GetBackendEnvironmentResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 122 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// GetBranch Request Marshaller
/// </summary>
public class GetBranchRequestMarshaller : IMarshaller<IRequest, GetBranchRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((GetBranchRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(GetBranchRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "GET";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (!publicRequest.IsSetBranchName())
throw new AmazonAmplifyException("Request object does not have required field BranchName set");
request.AddPathResource("{branchName}", StringUtils.FromString(publicRequest.BranchName));
request.ResourcePath = "/apps/{appId}/branches/{branchName}";
return request;
}
private static GetBranchRequestMarshaller _instance = new GetBranchRequestMarshaller();
internal static GetBranchRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static GetBranchRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 90 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for GetBranch operation
/// </summary>
public class GetBranchResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
GetBranchResponse response = new GetBranchResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("branch", targetDepth))
{
var unmarshaller = BranchUnmarshaller.Instance;
response.Branch = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static GetBranchResponseUnmarshaller _instance = new GetBranchResponseUnmarshaller();
internal static GetBranchResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static GetBranchResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 122 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// GetDomainAssociation Request Marshaller
/// </summary>
public class GetDomainAssociationRequestMarshaller : IMarshaller<IRequest, GetDomainAssociationRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((GetDomainAssociationRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(GetDomainAssociationRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "GET";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (!publicRequest.IsSetDomainName())
throw new AmazonAmplifyException("Request object does not have required field DomainName set");
request.AddPathResource("{domainName}", StringUtils.FromString(publicRequest.DomainName));
request.ResourcePath = "/apps/{appId}/domains/{domainName}";
return request;
}
private static GetDomainAssociationRequestMarshaller _instance = new GetDomainAssociationRequestMarshaller();
internal static GetDomainAssociationRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static GetDomainAssociationRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 90 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for GetDomainAssociation operation
/// </summary>
public class GetDomainAssociationResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
GetDomainAssociationResponse response = new GetDomainAssociationResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("domainAssociation", targetDepth))
{
var unmarshaller = DomainAssociationUnmarshaller.Instance;
response.DomainAssociation = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static GetDomainAssociationResponseUnmarshaller _instance = new GetDomainAssociationResponseUnmarshaller();
internal static GetDomainAssociationResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static GetDomainAssociationResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 122 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// GetJob Request Marshaller
/// </summary>
public class GetJobRequestMarshaller : IMarshaller<IRequest, GetJobRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((GetJobRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(GetJobRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "GET";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (!publicRequest.IsSetBranchName())
throw new AmazonAmplifyException("Request object does not have required field BranchName set");
request.AddPathResource("{branchName}", StringUtils.FromString(publicRequest.BranchName));
if (!publicRequest.IsSetJobId())
throw new AmazonAmplifyException("Request object does not have required field JobId set");
request.AddPathResource("{jobId}", StringUtils.FromString(publicRequest.JobId));
request.ResourcePath = "/apps/{appId}/branches/{branchName}/jobs/{jobId}";
return request;
}
private static GetJobRequestMarshaller _instance = new GetJobRequestMarshaller();
internal static GetJobRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static GetJobRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 93 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for GetJob operation
/// </summary>
public class GetJobResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
GetJobResponse response = new GetJobResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("job", targetDepth))
{
var unmarshaller = JobUnmarshaller.Instance;
response.Job = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("LimitExceededException"))
{
return LimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static GetJobResponseUnmarshaller _instance = new GetJobResponseUnmarshaller();
internal static GetJobResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static GetJobResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 126 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// GetWebhook Request Marshaller
/// </summary>
public class GetWebhookRequestMarshaller : IMarshaller<IRequest, GetWebhookRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((GetWebhookRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(GetWebhookRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "GET";
if (!publicRequest.IsSetWebhookId())
throw new AmazonAmplifyException("Request object does not have required field WebhookId set");
request.AddPathResource("{webhookId}", StringUtils.FromString(publicRequest.WebhookId));
request.ResourcePath = "/webhooks/{webhookId}";
return request;
}
private static GetWebhookRequestMarshaller _instance = new GetWebhookRequestMarshaller();
internal static GetWebhookRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static GetWebhookRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 87 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for GetWebhook operation
/// </summary>
public class GetWebhookResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
GetWebhookResponse response = new GetWebhookResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("webhook", targetDepth))
{
var unmarshaller = WebhookUnmarshaller.Instance;
response.Webhook = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("LimitExceededException"))
{
return LimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static GetWebhookResponseUnmarshaller _instance = new GetWebhookResponseUnmarshaller();
internal static GetWebhookResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static GetWebhookResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 126 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for InternalFailureException Object
/// </summary>
public class InternalFailureExceptionUnmarshaller : IErrorResponseUnmarshaller<InternalFailureException, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public InternalFailureException Unmarshall(JsonUnmarshallerContext context)
{
return this.Unmarshall(context, new Amazon.Runtime.Internal.ErrorResponse());
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <param name="errorResponse"></param>
/// <returns></returns>
public InternalFailureException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse)
{
context.Read();
InternalFailureException unmarshalledObject = new InternalFailureException(errorResponse.Message, errorResponse.InnerException,
errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
}
return unmarshalledObject;
}
private static InternalFailureExceptionUnmarshaller _instance = new InternalFailureExceptionUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static InternalFailureExceptionUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 85 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for JobSummary Object
/// </summary>
public class JobSummaryUnmarshaller : IUnmarshaller<JobSummary, XmlUnmarshallerContext>, IUnmarshaller<JobSummary, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
JobSummary IUnmarshaller<JobSummary, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
{
throw new NotImplementedException();
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public JobSummary Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
JobSummary unmarshalledObject = new JobSummary();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("commitId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.CommitId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("commitMessage", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.CommitMessage = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("commitTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.CommitTime = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("endTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.EndTime = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("jobArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.JobArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("jobId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.JobId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("jobType", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.JobType = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("startTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.StartTime = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("status", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Status = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static JobSummaryUnmarshaller _instance = new JobSummaryUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static JobSummaryUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 140 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for Job Object
/// </summary>
public class JobUnmarshaller : IUnmarshaller<Job, XmlUnmarshallerContext>, IUnmarshaller<Job, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
Job IUnmarshaller<Job, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
{
throw new NotImplementedException();
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public Job Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
Job unmarshalledObject = new Job();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("steps", targetDepth))
{
var unmarshaller = new ListUnmarshaller<Step, StepUnmarshaller>(StepUnmarshaller.Instance);
unmarshalledObject.Steps = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("summary", targetDepth))
{
var unmarshaller = JobSummaryUnmarshaller.Instance;
unmarshalledObject.Summary = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static JobUnmarshaller _instance = new JobUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static JobUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 98 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for LimitExceededException Object
/// </summary>
public class LimitExceededExceptionUnmarshaller : IErrorResponseUnmarshaller<LimitExceededException, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public LimitExceededException Unmarshall(JsonUnmarshallerContext context)
{
return this.Unmarshall(context, new Amazon.Runtime.Internal.ErrorResponse());
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <param name="errorResponse"></param>
/// <returns></returns>
public LimitExceededException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse)
{
context.Read();
LimitExceededException unmarshalledObject = new LimitExceededException(errorResponse.Message, errorResponse.InnerException,
errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
}
return unmarshalledObject;
}
private static LimitExceededExceptionUnmarshaller _instance = new LimitExceededExceptionUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static LimitExceededExceptionUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 85 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// ListApps Request Marshaller
/// </summary>
public class ListAppsRequestMarshaller : IMarshaller<IRequest, ListAppsRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((ListAppsRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(ListAppsRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "GET";
if (publicRequest.IsSetMaxResults())
request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults));
if (publicRequest.IsSetNextToken())
request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken));
request.ResourcePath = "/apps";
request.UseQueryString = true;
return request;
}
private static ListAppsRequestMarshaller _instance = new ListAppsRequestMarshaller();
internal static ListAppsRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListAppsRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 91 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for ListApps operation
/// </summary>
public class ListAppsResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <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("apps", targetDepth))
{
var unmarshaller = new ListUnmarshaller<App, AppUnmarshaller>(AppUnmarshaller.Instance);
response.Apps = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("nextToken", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.NextToken = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static ListAppsResponseUnmarshaller _instance = new ListAppsResponseUnmarshaller();
internal static ListAppsResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListAppsResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 124 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// ListArtifacts Request Marshaller
/// </summary>
public class ListArtifactsRequestMarshaller : IMarshaller<IRequest, ListArtifactsRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((ListArtifactsRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(ListArtifactsRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "GET";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (!publicRequest.IsSetBranchName())
throw new AmazonAmplifyException("Request object does not have required field BranchName set");
request.AddPathResource("{branchName}", StringUtils.FromString(publicRequest.BranchName));
if (!publicRequest.IsSetJobId())
throw new AmazonAmplifyException("Request object does not have required field JobId set");
request.AddPathResource("{jobId}", StringUtils.FromString(publicRequest.JobId));
if (publicRequest.IsSetMaxResults())
request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults));
if (publicRequest.IsSetNextToken())
request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken));
request.ResourcePath = "/apps/{appId}/branches/{branchName}/jobs/{jobId}/artifacts";
request.UseQueryString = true;
return request;
}
private static ListArtifactsRequestMarshaller _instance = new ListArtifactsRequestMarshaller();
internal static ListArtifactsRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListArtifactsRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 100 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for ListArtifacts operation
/// </summary>
public class ListArtifactsResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
ListArtifactsResponse response = new ListArtifactsResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("artifacts", targetDepth))
{
var unmarshaller = new ListUnmarshaller<Artifact, ArtifactUnmarshaller>(ArtifactUnmarshaller.Instance);
response.Artifacts = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("nextToken", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.NextToken = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("LimitExceededException"))
{
return LimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static ListArtifactsResponseUnmarshaller _instance = new ListArtifactsResponseUnmarshaller();
internal static ListArtifactsResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListArtifactsResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 128 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// ListBackendEnvironments Request Marshaller
/// </summary>
public class ListBackendEnvironmentsRequestMarshaller : IMarshaller<IRequest, ListBackendEnvironmentsRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((ListBackendEnvironmentsRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(ListBackendEnvironmentsRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "GET";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (publicRequest.IsSetEnvironmentName())
request.Parameters.Add("environmentName", StringUtils.FromString(publicRequest.EnvironmentName));
if (publicRequest.IsSetMaxResults())
request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults));
if (publicRequest.IsSetNextToken())
request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken));
request.ResourcePath = "/apps/{appId}/backendenvironments";
request.UseQueryString = true;
return request;
}
private static ListBackendEnvironmentsRequestMarshaller _instance = new ListBackendEnvironmentsRequestMarshaller();
internal static ListBackendEnvironmentsRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListBackendEnvironmentsRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 97 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for ListBackendEnvironments operation
/// </summary>
public class ListBackendEnvironmentsResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
ListBackendEnvironmentsResponse response = new ListBackendEnvironmentsResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("backendEnvironments", targetDepth))
{
var unmarshaller = new ListUnmarshaller<BackendEnvironment, BackendEnvironmentUnmarshaller>(BackendEnvironmentUnmarshaller.Instance);
response.BackendEnvironments = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("nextToken", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.NextToken = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static ListBackendEnvironmentsResponseUnmarshaller _instance = new ListBackendEnvironmentsResponseUnmarshaller();
internal static ListBackendEnvironmentsResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListBackendEnvironmentsResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 124 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// ListBranches Request Marshaller
/// </summary>
public class ListBranchesRequestMarshaller : IMarshaller<IRequest, ListBranchesRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((ListBranchesRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(ListBranchesRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "GET";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (publicRequest.IsSetMaxResults())
request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults));
if (publicRequest.IsSetNextToken())
request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken));
request.ResourcePath = "/apps/{appId}/branches";
request.UseQueryString = true;
return request;
}
private static ListBranchesRequestMarshaller _instance = new ListBranchesRequestMarshaller();
internal static ListBranchesRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListBranchesRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 94 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for ListBranches operation
/// </summary>
public class ListBranchesResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
ListBranchesResponse response = new ListBranchesResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("branches", targetDepth))
{
var unmarshaller = new ListUnmarshaller<Branch, BranchUnmarshaller>(BranchUnmarshaller.Instance);
response.Branches = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("nextToken", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.NextToken = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static ListBranchesResponseUnmarshaller _instance = new ListBranchesResponseUnmarshaller();
internal static ListBranchesResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListBranchesResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 124 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// ListDomainAssociations Request Marshaller
/// </summary>
public class ListDomainAssociationsRequestMarshaller : IMarshaller<IRequest, ListDomainAssociationsRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((ListDomainAssociationsRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(ListDomainAssociationsRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "GET";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (publicRequest.IsSetMaxResults())
request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults));
if (publicRequest.IsSetNextToken())
request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken));
request.ResourcePath = "/apps/{appId}/domains";
request.UseQueryString = true;
return request;
}
private static ListDomainAssociationsRequestMarshaller _instance = new ListDomainAssociationsRequestMarshaller();
internal static ListDomainAssociationsRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListDomainAssociationsRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 94 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for ListDomainAssociations operation
/// </summary>
public class ListDomainAssociationsResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
ListDomainAssociationsResponse response = new ListDomainAssociationsResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("domainAssociations", targetDepth))
{
var unmarshaller = new ListUnmarshaller<DomainAssociation, DomainAssociationUnmarshaller>(DomainAssociationUnmarshaller.Instance);
response.DomainAssociations = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("nextToken", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.NextToken = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static ListDomainAssociationsResponseUnmarshaller _instance = new ListDomainAssociationsResponseUnmarshaller();
internal static ListDomainAssociationsResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListDomainAssociationsResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 124 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// ListJobs Request Marshaller
/// </summary>
public class ListJobsRequestMarshaller : IMarshaller<IRequest, ListJobsRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((ListJobsRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(ListJobsRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "GET";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (!publicRequest.IsSetBranchName())
throw new AmazonAmplifyException("Request object does not have required field BranchName set");
request.AddPathResource("{branchName}", StringUtils.FromString(publicRequest.BranchName));
if (publicRequest.IsSetMaxResults())
request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults));
if (publicRequest.IsSetNextToken())
request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken));
request.ResourcePath = "/apps/{appId}/branches/{branchName}/jobs";
request.UseQueryString = true;
return request;
}
private static ListJobsRequestMarshaller _instance = new ListJobsRequestMarshaller();
internal static ListJobsRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListJobsRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 97 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for ListJobs operation
/// </summary>
public class ListJobsResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
ListJobsResponse response = new ListJobsResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("jobSummaries", targetDepth))
{
var unmarshaller = new ListUnmarshaller<JobSummary, JobSummaryUnmarshaller>(JobSummaryUnmarshaller.Instance);
response.JobSummaries = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("nextToken", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.NextToken = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("LimitExceededException"))
{
return LimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static ListJobsResponseUnmarshaller _instance = new ListJobsResponseUnmarshaller();
internal static ListJobsResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListJobsResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 128 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// ListTagsForResource Request Marshaller
/// </summary>
public class ListTagsForResourceRequestMarshaller : IMarshaller<IRequest, ListTagsForResourceRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((ListTagsForResourceRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(ListTagsForResourceRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "GET";
if (!publicRequest.IsSetResourceArn())
throw new AmazonAmplifyException("Request object does not have required field ResourceArn set");
request.AddPathResource("{resourceArn}", StringUtils.FromString(publicRequest.ResourceArn));
request.ResourcePath = "/tags/{resourceArn}";
return request;
}
private static ListTagsForResourceRequestMarshaller _instance = new ListTagsForResourceRequestMarshaller();
internal static ListTagsForResourceRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListTagsForResourceRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 87 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for ListTagsForResource operation
/// </summary>
public class ListTagsForResourceResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
ListTagsForResourceResponse response = new ListTagsForResourceResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("tags", targetDepth))
{
var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance);
response.Tags = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException"))
{
return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static ListTagsForResourceResponseUnmarshaller _instance = new ListTagsForResourceResponseUnmarshaller();
internal static ListTagsForResourceResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListTagsForResourceResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 118 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// ListWebhooks Request Marshaller
/// </summary>
public class ListWebhooksRequestMarshaller : IMarshaller<IRequest, ListWebhooksRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((ListWebhooksRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(ListWebhooksRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "GET";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (publicRequest.IsSetMaxResults())
request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults));
if (publicRequest.IsSetNextToken())
request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken));
request.ResourcePath = "/apps/{appId}/webhooks";
request.UseQueryString = true;
return request;
}
private static ListWebhooksRequestMarshaller _instance = new ListWebhooksRequestMarshaller();
internal static ListWebhooksRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListWebhooksRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 94 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for ListWebhooks operation
/// </summary>
public class ListWebhooksResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
ListWebhooksResponse response = new ListWebhooksResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("nextToken", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.NextToken = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("webhooks", targetDepth))
{
var unmarshaller = new ListUnmarshaller<Webhook, WebhookUnmarshaller>(WebhookUnmarshaller.Instance);
response.Webhooks = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("LimitExceededException"))
{
return LimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static ListWebhooksResponseUnmarshaller _instance = new ListWebhooksResponseUnmarshaller();
internal static ListWebhooksResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListWebhooksResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 128 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for NotFoundException Object
/// </summary>
public class NotFoundExceptionUnmarshaller : IErrorResponseUnmarshaller<NotFoundException, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public NotFoundException Unmarshall(JsonUnmarshallerContext context)
{
return this.Unmarshall(context, new Amazon.Runtime.Internal.ErrorResponse());
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <param name="errorResponse"></param>
/// <returns></returns>
public NotFoundException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse)
{
context.Read();
NotFoundException unmarshalledObject = new NotFoundException(errorResponse.Message, errorResponse.InnerException,
errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
}
return unmarshalledObject;
}
private static NotFoundExceptionUnmarshaller _instance = new NotFoundExceptionUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static NotFoundExceptionUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 85 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for ProductionBranch Object
/// </summary>
public class ProductionBranchUnmarshaller : IUnmarshaller<ProductionBranch, XmlUnmarshallerContext>, IUnmarshaller<ProductionBranch, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
ProductionBranch IUnmarshaller<ProductionBranch, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
{
throw new NotImplementedException();
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public ProductionBranch Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
ProductionBranch unmarshalledObject = new ProductionBranch();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("branchName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BranchName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("lastDeployTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.LastDeployTime = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("status", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Status = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("thumbnailUrl", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ThumbnailUrl = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static ProductionBranchUnmarshaller _instance = new ProductionBranchUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static ProductionBranchUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 110 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for ResourceNotFoundException Object
/// </summary>
public class ResourceNotFoundExceptionUnmarshaller : IErrorResponseUnmarshaller<ResourceNotFoundException, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public ResourceNotFoundException Unmarshall(JsonUnmarshallerContext context)
{
return this.Unmarshall(context, new Amazon.Runtime.Internal.ErrorResponse());
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <param name="errorResponse"></param>
/// <returns></returns>
public ResourceNotFoundException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse)
{
context.Read();
ResourceNotFoundException unmarshalledObject = new ResourceNotFoundException(errorResponse.Message, errorResponse.InnerException,
errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("code", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Code = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static ResourceNotFoundExceptionUnmarshaller _instance = new ResourceNotFoundExceptionUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static ResourceNotFoundExceptionUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 91 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// StartDeployment Request Marshaller
/// </summary>
public class StartDeploymentRequestMarshaller : IMarshaller<IRequest, StartDeploymentRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((StartDeploymentRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(StartDeploymentRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers["Content-Type"] = "application/json";
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "POST";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (!publicRequest.IsSetBranchName())
throw new AmazonAmplifyException("Request object does not have required field BranchName set");
request.AddPathResource("{branchName}", StringUtils.FromString(publicRequest.BranchName));
request.ResourcePath = "/apps/{appId}/branches/{branchName}/deployments/start";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetJobId())
{
context.Writer.WritePropertyName("jobId");
context.Writer.Write(publicRequest.JobId);
}
if(publicRequest.IsSetSourceUrl())
{
context.Writer.WritePropertyName("sourceUrl");
context.Writer.Write(publicRequest.SourceUrl);
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static StartDeploymentRequestMarshaller _instance = new StartDeploymentRequestMarshaller();
internal static StartDeploymentRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static StartDeploymentRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 113 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for StartDeployment operation
/// </summary>
public class StartDeploymentResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
StartDeploymentResponse response = new StartDeploymentResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("jobSummary", targetDepth))
{
var unmarshaller = JobSummaryUnmarshaller.Instance;
response.JobSummary = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("LimitExceededException"))
{
return LimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static StartDeploymentResponseUnmarshaller _instance = new StartDeploymentResponseUnmarshaller();
internal static StartDeploymentResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static StartDeploymentResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 126 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// StartJob Request Marshaller
/// </summary>
public class StartJobRequestMarshaller : IMarshaller<IRequest, StartJobRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((StartJobRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(StartJobRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers["Content-Type"] = "application/json";
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "POST";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (!publicRequest.IsSetBranchName())
throw new AmazonAmplifyException("Request object does not have required field BranchName set");
request.AddPathResource("{branchName}", StringUtils.FromString(publicRequest.BranchName));
request.ResourcePath = "/apps/{appId}/branches/{branchName}/jobs";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetCommitId())
{
context.Writer.WritePropertyName("commitId");
context.Writer.Write(publicRequest.CommitId);
}
if(publicRequest.IsSetCommitMessage())
{
context.Writer.WritePropertyName("commitMessage");
context.Writer.Write(publicRequest.CommitMessage);
}
if(publicRequest.IsSetCommitTime())
{
context.Writer.WritePropertyName("commitTime");
context.Writer.Write(publicRequest.CommitTime);
}
if(publicRequest.IsSetJobId())
{
context.Writer.WritePropertyName("jobId");
context.Writer.Write(publicRequest.JobId);
}
if(publicRequest.IsSetJobReason())
{
context.Writer.WritePropertyName("jobReason");
context.Writer.Write(publicRequest.JobReason);
}
if(publicRequest.IsSetJobType())
{
context.Writer.WritePropertyName("jobType");
context.Writer.Write(publicRequest.JobType);
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static StartJobRequestMarshaller _instance = new StartJobRequestMarshaller();
internal static StartJobRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static StartJobRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 137 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for StartJob operation
/// </summary>
public class StartJobResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
StartJobResponse response = new StartJobResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("jobSummary", targetDepth))
{
var unmarshaller = JobSummaryUnmarshaller.Instance;
response.JobSummary = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("LimitExceededException"))
{
return LimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static StartJobResponseUnmarshaller _instance = new StartJobResponseUnmarshaller();
internal static StartJobResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static StartJobResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 126 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for Step Object
/// </summary>
public class StepUnmarshaller : IUnmarshaller<Step, XmlUnmarshallerContext>, IUnmarshaller<Step, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
Step IUnmarshaller<Step, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
{
throw new NotImplementedException();
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public Step Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
Step unmarshalledObject = new Step();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("artifactsUrl", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ArtifactsUrl = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("context", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Context = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("endTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.EndTime = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("logUrl", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.LogUrl = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("screenshots", targetDepth))
{
var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance);
unmarshalledObject.Screenshots = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("startTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.StartTime = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("status", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Status = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("statusReason", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.StatusReason = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("stepName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.StepName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("testArtifactsUrl", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.TestArtifactsUrl = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("testConfigUrl", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.TestConfigUrl = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static StepUnmarshaller _instance = new StepUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static StepUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 152 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// StopJob Request Marshaller
/// </summary>
public class StopJobRequestMarshaller : IMarshaller<IRequest, StopJobRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((StopJobRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(StopJobRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "DELETE";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (!publicRequest.IsSetBranchName())
throw new AmazonAmplifyException("Request object does not have required field BranchName set");
request.AddPathResource("{branchName}", StringUtils.FromString(publicRequest.BranchName));
if (!publicRequest.IsSetJobId())
throw new AmazonAmplifyException("Request object does not have required field JobId set");
request.AddPathResource("{jobId}", StringUtils.FromString(publicRequest.JobId));
request.ResourcePath = "/apps/{appId}/branches/{branchName}/jobs/{jobId}/stop";
return request;
}
private static StopJobRequestMarshaller _instance = new StopJobRequestMarshaller();
internal static StopJobRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static StopJobRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 93 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for StopJob operation
/// </summary>
public class StopJobResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
StopJobResponse response = new StopJobResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("jobSummary", targetDepth))
{
var unmarshaller = JobSummaryUnmarshaller.Instance;
response.JobSummary = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("LimitExceededException"))
{
return LimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static StopJobResponseUnmarshaller _instance = new StopJobResponseUnmarshaller();
internal static StopJobResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static StopJobResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 126 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// SubDomainSetting Marshaller
/// </summary>
public class SubDomainSettingMarshaller : IRequestMarshaller<SubDomainSetting, JsonMarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="requestObject"></param>
/// <param name="context"></param>
/// <returns></returns>
public void Marshall(SubDomainSetting requestObject, JsonMarshallerContext context)
{
if(requestObject.IsSetBranchName())
{
context.Writer.WritePropertyName("branchName");
context.Writer.Write(requestObject.BranchName);
}
if(requestObject.IsSetPrefix())
{
context.Writer.WritePropertyName("prefix");
context.Writer.Write(requestObject.Prefix);
}
}
/// <summary>
/// Singleton Marshaller.
/// </summary>
public readonly static SubDomainSettingMarshaller Instance = new SubDomainSettingMarshaller();
}
} | 68 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for SubDomainSetting Object
/// </summary>
public class SubDomainSettingUnmarshaller : IUnmarshaller<SubDomainSetting, XmlUnmarshallerContext>, IUnmarshaller<SubDomainSetting, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
SubDomainSetting IUnmarshaller<SubDomainSetting, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
{
throw new NotImplementedException();
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public SubDomainSetting Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
SubDomainSetting unmarshalledObject = new SubDomainSetting();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("branchName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BranchName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("prefix", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Prefix = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static SubDomainSettingUnmarshaller _instance = new SubDomainSettingUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static SubDomainSettingUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 98 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for SubDomain Object
/// </summary>
public class SubDomainUnmarshaller : IUnmarshaller<SubDomain, XmlUnmarshallerContext>, IUnmarshaller<SubDomain, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
SubDomain IUnmarshaller<SubDomain, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
{
throw new NotImplementedException();
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public SubDomain Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
SubDomain unmarshalledObject = new SubDomain();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("dnsRecord", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DnsRecord = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("subDomainSetting", targetDepth))
{
var unmarshaller = SubDomainSettingUnmarshaller.Instance;
unmarshalledObject.SubDomainSetting = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("verified", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.Verified = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static SubDomainUnmarshaller _instance = new SubDomainUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static SubDomainUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 104 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// TagResource Request Marshaller
/// </summary>
public class TagResourceRequestMarshaller : IMarshaller<IRequest, TagResourceRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((TagResourceRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(TagResourceRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers["Content-Type"] = "application/json";
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "POST";
if (!publicRequest.IsSetResourceArn())
throw new AmazonAmplifyException("Request object does not have required field ResourceArn set");
request.AddPathResource("{resourceArn}", StringUtils.FromString(publicRequest.ResourceArn));
request.ResourcePath = "/tags/{resourceArn}";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetTags())
{
context.Writer.WritePropertyName("tags");
context.Writer.WriteObjectStart();
foreach (var publicRequestTagsKvp in publicRequest.Tags)
{
context.Writer.WritePropertyName(publicRequestTagsKvp.Key);
var publicRequestTagsValue = publicRequestTagsKvp.Value;
context.Writer.Write(publicRequestTagsValue);
}
context.Writer.WriteObjectEnd();
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static TagResourceRequestMarshaller _instance = new TagResourceRequestMarshaller();
internal static TagResourceRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static TagResourceRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 112 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for TagResource operation
/// </summary>
public class TagResourceResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
TagResourceResponse response = new TagResourceResponse();
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException"))
{
return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static TagResourceResponseUnmarshaller _instance = new TagResourceResponseUnmarshaller();
internal static TagResourceResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static TagResourceResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 107 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for UnauthorizedException Object
/// </summary>
public class UnauthorizedExceptionUnmarshaller : IErrorResponseUnmarshaller<UnauthorizedException, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public UnauthorizedException Unmarshall(JsonUnmarshallerContext context)
{
return this.Unmarshall(context, new Amazon.Runtime.Internal.ErrorResponse());
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <param name="errorResponse"></param>
/// <returns></returns>
public UnauthorizedException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse)
{
context.Read();
UnauthorizedException unmarshalledObject = new UnauthorizedException(errorResponse.Message, errorResponse.InnerException,
errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
}
return unmarshalledObject;
}
private static UnauthorizedExceptionUnmarshaller _instance = new UnauthorizedExceptionUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static UnauthorizedExceptionUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 85 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// UntagResource Request Marshaller
/// </summary>
public class UntagResourceRequestMarshaller : IMarshaller<IRequest, UntagResourceRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((UntagResourceRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(UntagResourceRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "DELETE";
if (!publicRequest.IsSetResourceArn())
throw new AmazonAmplifyException("Request object does not have required field ResourceArn set");
request.AddPathResource("{resourceArn}", StringUtils.FromString(publicRequest.ResourceArn));
if (publicRequest.IsSetTagKeys())
request.ParameterCollection.Add("tagKeys", publicRequest.TagKeys);
request.ResourcePath = "/tags/{resourceArn}";
request.UseQueryString = true;
return request;
}
private static UntagResourceRequestMarshaller _instance = new UntagResourceRequestMarshaller();
internal static UntagResourceRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UntagResourceRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 91 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for UntagResource operation
/// </summary>
public class UntagResourceResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
UntagResourceResponse response = new UntagResourceResponse();
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException"))
{
return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static UntagResourceResponseUnmarshaller _instance = new UntagResourceResponseUnmarshaller();
internal static UntagResourceResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UntagResourceResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 107 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// UpdateApp Request Marshaller
/// </summary>
public class UpdateAppRequestMarshaller : IMarshaller<IRequest, UpdateAppRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((UpdateAppRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(UpdateAppRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers["Content-Type"] = "application/json";
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "POST";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
request.ResourcePath = "/apps/{appId}";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetAccessToken())
{
context.Writer.WritePropertyName("accessToken");
context.Writer.Write(publicRequest.AccessToken);
}
if(publicRequest.IsSetAutoBranchCreationConfig())
{
context.Writer.WritePropertyName("autoBranchCreationConfig");
context.Writer.WriteObjectStart();
var marshaller = AutoBranchCreationConfigMarshaller.Instance;
marshaller.Marshall(publicRequest.AutoBranchCreationConfig, context);
context.Writer.WriteObjectEnd();
}
if(publicRequest.IsSetAutoBranchCreationPatterns())
{
context.Writer.WritePropertyName("autoBranchCreationPatterns");
context.Writer.WriteArrayStart();
foreach(var publicRequestAutoBranchCreationPatternsListValue in publicRequest.AutoBranchCreationPatterns)
{
context.Writer.Write(publicRequestAutoBranchCreationPatternsListValue);
}
context.Writer.WriteArrayEnd();
}
if(publicRequest.IsSetBasicAuthCredentials())
{
context.Writer.WritePropertyName("basicAuthCredentials");
context.Writer.Write(publicRequest.BasicAuthCredentials);
}
if(publicRequest.IsSetBuildSpec())
{
context.Writer.WritePropertyName("buildSpec");
context.Writer.Write(publicRequest.BuildSpec);
}
if(publicRequest.IsSetCustomHeaders())
{
context.Writer.WritePropertyName("customHeaders");
context.Writer.Write(publicRequest.CustomHeaders);
}
if(publicRequest.IsSetCustomRules())
{
context.Writer.WritePropertyName("customRules");
context.Writer.WriteArrayStart();
foreach(var publicRequestCustomRulesListValue in publicRequest.CustomRules)
{
context.Writer.WriteObjectStart();
var marshaller = CustomRuleMarshaller.Instance;
marshaller.Marshall(publicRequestCustomRulesListValue, context);
context.Writer.WriteObjectEnd();
}
context.Writer.WriteArrayEnd();
}
if(publicRequest.IsSetDescription())
{
context.Writer.WritePropertyName("description");
context.Writer.Write(publicRequest.Description);
}
if(publicRequest.IsSetEnableAutoBranchCreation())
{
context.Writer.WritePropertyName("enableAutoBranchCreation");
context.Writer.Write(publicRequest.EnableAutoBranchCreation);
}
if(publicRequest.IsSetEnableBasicAuth())
{
context.Writer.WritePropertyName("enableBasicAuth");
context.Writer.Write(publicRequest.EnableBasicAuth);
}
if(publicRequest.IsSetEnableBranchAutoBuild())
{
context.Writer.WritePropertyName("enableBranchAutoBuild");
context.Writer.Write(publicRequest.EnableBranchAutoBuild);
}
if(publicRequest.IsSetEnableBranchAutoDeletion())
{
context.Writer.WritePropertyName("enableBranchAutoDeletion");
context.Writer.Write(publicRequest.EnableBranchAutoDeletion);
}
if(publicRequest.IsSetEnvironmentVariables())
{
context.Writer.WritePropertyName("environmentVariables");
context.Writer.WriteObjectStart();
foreach (var publicRequestEnvironmentVariablesKvp in publicRequest.EnvironmentVariables)
{
context.Writer.WritePropertyName(publicRequestEnvironmentVariablesKvp.Key);
var publicRequestEnvironmentVariablesValue = publicRequestEnvironmentVariablesKvp.Value;
context.Writer.Write(publicRequestEnvironmentVariablesValue);
}
context.Writer.WriteObjectEnd();
}
if(publicRequest.IsSetIamServiceRoleArn())
{
context.Writer.WritePropertyName("iamServiceRoleArn");
context.Writer.Write(publicRequest.IamServiceRoleArn);
}
if(publicRequest.IsSetName())
{
context.Writer.WritePropertyName("name");
context.Writer.Write(publicRequest.Name);
}
if(publicRequest.IsSetOauthToken())
{
context.Writer.WritePropertyName("oauthToken");
context.Writer.Write(publicRequest.OauthToken);
}
if(publicRequest.IsSetPlatform())
{
context.Writer.WritePropertyName("platform");
context.Writer.Write(publicRequest.Platform);
}
if(publicRequest.IsSetRepository())
{
context.Writer.WritePropertyName("repository");
context.Writer.Write(publicRequest.Repository);
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static UpdateAppRequestMarshaller _instance = new UpdateAppRequestMarshaller();
internal static UpdateAppRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateAppRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 234 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for UpdateApp operation
/// </summary>
public class UpdateAppResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
UpdateAppResponse response = new UpdateAppResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("app", targetDepth))
{
var unmarshaller = AppUnmarshaller.Instance;
response.App = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static UpdateAppResponseUnmarshaller _instance = new UpdateAppResponseUnmarshaller();
internal static UpdateAppResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateAppResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 122 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// UpdateBranch Request Marshaller
/// </summary>
public class UpdateBranchRequestMarshaller : IMarshaller<IRequest, UpdateBranchRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((UpdateBranchRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(UpdateBranchRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers["Content-Type"] = "application/json";
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "POST";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (!publicRequest.IsSetBranchName())
throw new AmazonAmplifyException("Request object does not have required field BranchName set");
request.AddPathResource("{branchName}", StringUtils.FromString(publicRequest.BranchName));
request.ResourcePath = "/apps/{appId}/branches/{branchName}";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetBackendEnvironmentArn())
{
context.Writer.WritePropertyName("backendEnvironmentArn");
context.Writer.Write(publicRequest.BackendEnvironmentArn);
}
if(publicRequest.IsSetBasicAuthCredentials())
{
context.Writer.WritePropertyName("basicAuthCredentials");
context.Writer.Write(publicRequest.BasicAuthCredentials);
}
if(publicRequest.IsSetBuildSpec())
{
context.Writer.WritePropertyName("buildSpec");
context.Writer.Write(publicRequest.BuildSpec);
}
if(publicRequest.IsSetDescription())
{
context.Writer.WritePropertyName("description");
context.Writer.Write(publicRequest.Description);
}
if(publicRequest.IsSetDisplayName())
{
context.Writer.WritePropertyName("displayName");
context.Writer.Write(publicRequest.DisplayName);
}
if(publicRequest.IsSetEnableAutoBuild())
{
context.Writer.WritePropertyName("enableAutoBuild");
context.Writer.Write(publicRequest.EnableAutoBuild);
}
if(publicRequest.IsSetEnableBasicAuth())
{
context.Writer.WritePropertyName("enableBasicAuth");
context.Writer.Write(publicRequest.EnableBasicAuth);
}
if(publicRequest.IsSetEnableNotification())
{
context.Writer.WritePropertyName("enableNotification");
context.Writer.Write(publicRequest.EnableNotification);
}
if(publicRequest.IsSetEnablePerformanceMode())
{
context.Writer.WritePropertyName("enablePerformanceMode");
context.Writer.Write(publicRequest.EnablePerformanceMode);
}
if(publicRequest.IsSetEnablePullRequestPreview())
{
context.Writer.WritePropertyName("enablePullRequestPreview");
context.Writer.Write(publicRequest.EnablePullRequestPreview);
}
if(publicRequest.IsSetEnvironmentVariables())
{
context.Writer.WritePropertyName("environmentVariables");
context.Writer.WriteObjectStart();
foreach (var publicRequestEnvironmentVariablesKvp in publicRequest.EnvironmentVariables)
{
context.Writer.WritePropertyName(publicRequestEnvironmentVariablesKvp.Key);
var publicRequestEnvironmentVariablesValue = publicRequestEnvironmentVariablesKvp.Value;
context.Writer.Write(publicRequestEnvironmentVariablesValue);
}
context.Writer.WriteObjectEnd();
}
if(publicRequest.IsSetFramework())
{
context.Writer.WritePropertyName("framework");
context.Writer.Write(publicRequest.Framework);
}
if(publicRequest.IsSetPullRequestEnvironmentName())
{
context.Writer.WritePropertyName("pullRequestEnvironmentName");
context.Writer.Write(publicRequest.PullRequestEnvironmentName);
}
if(publicRequest.IsSetStage())
{
context.Writer.WritePropertyName("stage");
context.Writer.Write(publicRequest.Stage);
}
if(publicRequest.IsSetTtl())
{
context.Writer.WritePropertyName("ttl");
context.Writer.Write(publicRequest.Ttl);
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static UpdateBranchRequestMarshaller _instance = new UpdateBranchRequestMarshaller();
internal static UpdateBranchRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateBranchRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 199 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for UpdateBranch operation
/// </summary>
public class UpdateBranchResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
UpdateBranchResponse response = new UpdateBranchResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("branch", targetDepth))
{
var unmarshaller = BranchUnmarshaller.Instance;
response.Branch = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("DependentServiceFailureException"))
{
return DependentServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static UpdateBranchResponseUnmarshaller _instance = new UpdateBranchResponseUnmarshaller();
internal static UpdateBranchResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateBranchResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 126 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// UpdateDomainAssociation Request Marshaller
/// </summary>
public class UpdateDomainAssociationRequestMarshaller : IMarshaller<IRequest, UpdateDomainAssociationRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((UpdateDomainAssociationRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(UpdateDomainAssociationRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers["Content-Type"] = "application/json";
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "POST";
if (!publicRequest.IsSetAppId())
throw new AmazonAmplifyException("Request object does not have required field AppId set");
request.AddPathResource("{appId}", StringUtils.FromString(publicRequest.AppId));
if (!publicRequest.IsSetDomainName())
throw new AmazonAmplifyException("Request object does not have required field DomainName set");
request.AddPathResource("{domainName}", StringUtils.FromString(publicRequest.DomainName));
request.ResourcePath = "/apps/{appId}/domains/{domainName}";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetAutoSubDomainCreationPatterns())
{
context.Writer.WritePropertyName("autoSubDomainCreationPatterns");
context.Writer.WriteArrayStart();
foreach(var publicRequestAutoSubDomainCreationPatternsListValue in publicRequest.AutoSubDomainCreationPatterns)
{
context.Writer.Write(publicRequestAutoSubDomainCreationPatternsListValue);
}
context.Writer.WriteArrayEnd();
}
if(publicRequest.IsSetAutoSubDomainIAMRole())
{
context.Writer.WritePropertyName("autoSubDomainIAMRole");
context.Writer.Write(publicRequest.AutoSubDomainIAMRole);
}
if(publicRequest.IsSetEnableAutoSubDomain())
{
context.Writer.WritePropertyName("enableAutoSubDomain");
context.Writer.Write(publicRequest.EnableAutoSubDomain);
}
if(publicRequest.IsSetSubDomainSettings())
{
context.Writer.WritePropertyName("subDomainSettings");
context.Writer.WriteArrayStart();
foreach(var publicRequestSubDomainSettingsListValue in publicRequest.SubDomainSettings)
{
context.Writer.WriteObjectStart();
var marshaller = SubDomainSettingMarshaller.Instance;
marshaller.Marshall(publicRequestSubDomainSettingsListValue, context);
context.Writer.WriteObjectEnd();
}
context.Writer.WriteArrayEnd();
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static UpdateDomainAssociationRequestMarshaller _instance = new UpdateDomainAssociationRequestMarshaller();
internal static UpdateDomainAssociationRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateDomainAssociationRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 140 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for UpdateDomainAssociation operation
/// </summary>
public class UpdateDomainAssociationResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
UpdateDomainAssociationResponse response = new UpdateDomainAssociationResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("domainAssociation", targetDepth))
{
var unmarshaller = DomainAssociationUnmarshaller.Instance;
response.DomainAssociation = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("DependentServiceFailureException"))
{
return DependentServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static UpdateDomainAssociationResponseUnmarshaller _instance = new UpdateDomainAssociationResponseUnmarshaller();
internal static UpdateDomainAssociationResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateDomainAssociationResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 126 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// UpdateWebhook Request Marshaller
/// </summary>
public class UpdateWebhookRequestMarshaller : IMarshaller<IRequest, UpdateWebhookRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((UpdateWebhookRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(UpdateWebhookRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Amplify");
request.Headers["Content-Type"] = "application/json";
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25";
request.HttpMethod = "POST";
if (!publicRequest.IsSetWebhookId())
throw new AmazonAmplifyException("Request object does not have required field WebhookId set");
request.AddPathResource("{webhookId}", StringUtils.FromString(publicRequest.WebhookId));
request.ResourcePath = "/webhooks/{webhookId}";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetBranchName())
{
context.Writer.WritePropertyName("branchName");
context.Writer.Write(publicRequest.BranchName);
}
if(publicRequest.IsSetDescription())
{
context.Writer.WritePropertyName("description");
context.Writer.Write(publicRequest.Description);
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static UpdateWebhookRequestMarshaller _instance = new UpdateWebhookRequestMarshaller();
internal static UpdateWebhookRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateWebhookRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 110 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the amplify-2017-07-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.Amplify.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Amplify.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for UpdateWebhook operation
/// </summary>
public class UpdateWebhookResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
UpdateWebhookResponse response = new UpdateWebhookResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("webhook", targetDepth))
{
var unmarshaller = WebhookUnmarshaller.Instance;
response.Webhook = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException"))
{
return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("DependentServiceFailureException"))
{
return DependentServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException"))
{
return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException"))
{
return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedException"))
{
return UnauthorizedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonAmplifyException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static UpdateWebhookResponseUnmarshaller _instance = new UpdateWebhookResponseUnmarshaller();
internal static UpdateWebhookResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateWebhookResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 126 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.