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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for AppInstanceAdminSummary Object /// </summary> public class AppInstanceAdminSummaryUnmarshaller : IUnmarshaller<AppInstanceAdminSummary, XmlUnmarshallerContext>, IUnmarshaller<AppInstanceAdminSummary, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> AppInstanceAdminSummary IUnmarshaller<AppInstanceAdminSummary, 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 AppInstanceAdminSummary Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; AppInstanceAdminSummary unmarshalledObject = new AppInstanceAdminSummary(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Admin", targetDepth)) { var unmarshaller = IdentityUnmarshaller.Instance; unmarshalledObject.Admin = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static AppInstanceAdminSummaryUnmarshaller _instance = new AppInstanceAdminSummaryUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static AppInstanceAdminSummaryUnmarshaller Instance { get { return _instance; } } } }
92
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for AppInstanceAdmin Object /// </summary> public class AppInstanceAdminUnmarshaller : IUnmarshaller<AppInstanceAdmin, XmlUnmarshallerContext>, IUnmarshaller<AppInstanceAdmin, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> AppInstanceAdmin IUnmarshaller<AppInstanceAdmin, 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 AppInstanceAdmin Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; AppInstanceAdmin unmarshalledObject = new AppInstanceAdmin(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Admin", targetDepth)) { var unmarshaller = IdentityUnmarshaller.Instance; unmarshalledObject.Admin = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("AppInstanceArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.AppInstanceArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreatedTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.CreatedTimestamp = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static AppInstanceAdminUnmarshaller _instance = new AppInstanceAdminUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static AppInstanceAdminUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// AppInstanceRetentionSettings Marshaller /// </summary> public class AppInstanceRetentionSettingsMarshaller : IRequestMarshaller<AppInstanceRetentionSettings, 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(AppInstanceRetentionSettings requestObject, JsonMarshallerContext context) { if(requestObject.IsSetChannelRetentionSettings()) { context.Writer.WritePropertyName("ChannelRetentionSettings"); context.Writer.WriteObjectStart(); var marshaller = ChannelRetentionSettingsMarshaller.Instance; marshaller.Marshall(requestObject.ChannelRetentionSettings, context); context.Writer.WriteObjectEnd(); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static AppInstanceRetentionSettingsMarshaller Instance = new AppInstanceRetentionSettingsMarshaller(); } }
67
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for AppInstanceRetentionSettings Object /// </summary> public class AppInstanceRetentionSettingsUnmarshaller : IUnmarshaller<AppInstanceRetentionSettings, XmlUnmarshallerContext>, IUnmarshaller<AppInstanceRetentionSettings, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> AppInstanceRetentionSettings IUnmarshaller<AppInstanceRetentionSettings, 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 AppInstanceRetentionSettings Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; AppInstanceRetentionSettings unmarshalledObject = new AppInstanceRetentionSettings(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ChannelRetentionSettings", targetDepth)) { var unmarshaller = ChannelRetentionSettingsUnmarshaller.Instance; unmarshalledObject.ChannelRetentionSettings = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static AppInstanceRetentionSettingsUnmarshaller _instance = new AppInstanceRetentionSettingsUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static AppInstanceRetentionSettingsUnmarshaller Instance { get { return _instance; } } } }
92
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// AppInstanceStreamingConfiguration Marshaller /// </summary> public class AppInstanceStreamingConfigurationMarshaller : IRequestMarshaller<AppInstanceStreamingConfiguration, 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(AppInstanceStreamingConfiguration requestObject, JsonMarshallerContext context) { if(requestObject.IsSetAppInstanceDataType()) { context.Writer.WritePropertyName("AppInstanceDataType"); context.Writer.Write(requestObject.AppInstanceDataType); } if(requestObject.IsSetResourceArn()) { context.Writer.WritePropertyName("ResourceArn"); context.Writer.Write(requestObject.ResourceArn); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static AppInstanceStreamingConfigurationMarshaller Instance = new AppInstanceStreamingConfigurationMarshaller(); } }
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for AppInstanceStreamingConfiguration Object /// </summary> public class AppInstanceStreamingConfigurationUnmarshaller : IUnmarshaller<AppInstanceStreamingConfiguration, XmlUnmarshallerContext>, IUnmarshaller<AppInstanceStreamingConfiguration, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> AppInstanceStreamingConfiguration IUnmarshaller<AppInstanceStreamingConfiguration, 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 AppInstanceStreamingConfiguration Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; AppInstanceStreamingConfiguration unmarshalledObject = new AppInstanceStreamingConfiguration(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("AppInstanceDataType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.AppInstanceDataType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ResourceArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ResourceArn = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static AppInstanceStreamingConfigurationUnmarshaller _instance = new AppInstanceStreamingConfigurationUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static AppInstanceStreamingConfigurationUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for AppInstanceSummary Object /// </summary> public class AppInstanceSummaryUnmarshaller : IUnmarshaller<AppInstanceSummary, XmlUnmarshallerContext>, IUnmarshaller<AppInstanceSummary, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> AppInstanceSummary IUnmarshaller<AppInstanceSummary, 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 AppInstanceSummary Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; AppInstanceSummary unmarshalledObject = new AppInstanceSummary(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("AppInstanceArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.AppInstanceArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Metadata", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Metadata = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Name", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Name = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static AppInstanceSummaryUnmarshaller _instance = new AppInstanceSummaryUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static AppInstanceSummaryUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for AppInstance Object /// </summary> public class AppInstanceUnmarshaller : IUnmarshaller<AppInstance, XmlUnmarshallerContext>, IUnmarshaller<AppInstance, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> AppInstance IUnmarshaller<AppInstance, 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 AppInstance Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; AppInstance unmarshalledObject = new AppInstance(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("AppInstanceArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.AppInstanceArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreatedTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.CreatedTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LastUpdatedTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.LastUpdatedTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Metadata", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Metadata = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Name", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Name = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static AppInstanceUnmarshaller _instance = new AppInstanceUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static AppInstanceUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for AppInstanceUserMembershipSummary Object /// </summary> public class AppInstanceUserMembershipSummaryUnmarshaller : IUnmarshaller<AppInstanceUserMembershipSummary, XmlUnmarshallerContext>, IUnmarshaller<AppInstanceUserMembershipSummary, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> AppInstanceUserMembershipSummary IUnmarshaller<AppInstanceUserMembershipSummary, 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 AppInstanceUserMembershipSummary Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; AppInstanceUserMembershipSummary unmarshalledObject = new AppInstanceUserMembershipSummary(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ReadMarkerTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.ReadMarkerTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Type", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Type = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static AppInstanceUserMembershipSummaryUnmarshaller _instance = new AppInstanceUserMembershipSummaryUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static AppInstanceUserMembershipSummaryUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for AppInstanceUserSummary Object /// </summary> public class AppInstanceUserSummaryUnmarshaller : IUnmarshaller<AppInstanceUserSummary, XmlUnmarshallerContext>, IUnmarshaller<AppInstanceUserSummary, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> AppInstanceUserSummary IUnmarshaller<AppInstanceUserSummary, 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 AppInstanceUserSummary Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; AppInstanceUserSummary unmarshalledObject = new AppInstanceUserSummary(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("AppInstanceUserArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.AppInstanceUserArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Metadata", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Metadata = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Name", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Name = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static AppInstanceUserSummaryUnmarshaller _instance = new AppInstanceUserSummaryUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static AppInstanceUserSummaryUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for AppInstanceUser Object /// </summary> public class AppInstanceUserUnmarshaller : IUnmarshaller<AppInstanceUser, XmlUnmarshallerContext>, IUnmarshaller<AppInstanceUser, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> AppInstanceUser IUnmarshaller<AppInstanceUser, 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 AppInstanceUser Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; AppInstanceUser unmarshalledObject = new AppInstanceUser(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("AppInstanceUserArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.AppInstanceUserArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreatedTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.CreatedTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LastUpdatedTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.LastUpdatedTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Metadata", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Metadata = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Name", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Name = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static AppInstanceUserUnmarshaller _instance = new AppInstanceUserUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static AppInstanceUserUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// ArtifactsConfiguration Marshaller /// </summary> public class ArtifactsConfigurationMarshaller : IRequestMarshaller<ArtifactsConfiguration, 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(ArtifactsConfiguration requestObject, JsonMarshallerContext context) { if(requestObject.IsSetAudio()) { context.Writer.WritePropertyName("Audio"); context.Writer.WriteObjectStart(); var marshaller = AudioArtifactsConfigurationMarshaller.Instance; marshaller.Marshall(requestObject.Audio, context); context.Writer.WriteObjectEnd(); } if(requestObject.IsSetContent()) { context.Writer.WritePropertyName("Content"); context.Writer.WriteObjectStart(); var marshaller = ContentArtifactsConfigurationMarshaller.Instance; marshaller.Marshall(requestObject.Content, context); context.Writer.WriteObjectEnd(); } if(requestObject.IsSetVideo()) { context.Writer.WritePropertyName("Video"); context.Writer.WriteObjectStart(); var marshaller = VideoArtifactsConfigurationMarshaller.Instance; marshaller.Marshall(requestObject.Video, context); context.Writer.WriteObjectEnd(); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static ArtifactsConfigurationMarshaller Instance = new ArtifactsConfigurationMarshaller(); } }
89
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ArtifactsConfiguration Object /// </summary> public class ArtifactsConfigurationUnmarshaller : IUnmarshaller<ArtifactsConfiguration, XmlUnmarshallerContext>, IUnmarshaller<ArtifactsConfiguration, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> ArtifactsConfiguration IUnmarshaller<ArtifactsConfiguration, 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 ArtifactsConfiguration Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; ArtifactsConfiguration unmarshalledObject = new ArtifactsConfiguration(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Audio", targetDepth)) { var unmarshaller = AudioArtifactsConfigurationUnmarshaller.Instance; unmarshalledObject.Audio = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Content", targetDepth)) { var unmarshaller = ContentArtifactsConfigurationUnmarshaller.Instance; unmarshalledObject.Content = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Video", targetDepth)) { var unmarshaller = VideoArtifactsConfigurationUnmarshaller.Instance; unmarshalledObject.Video = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static ArtifactsConfigurationUnmarshaller _instance = new ArtifactsConfigurationUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ArtifactsConfigurationUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// AssociatePhoneNumbersWithVoiceConnectorGroup Request Marshaller /// </summary> public class AssociatePhoneNumbersWithVoiceConnectorGroupRequestMarshaller : IMarshaller<IRequest, AssociatePhoneNumbersWithVoiceConnectorGroupRequest> , 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((AssociatePhoneNumbersWithVoiceConnectorGroupRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(AssociatePhoneNumbersWithVoiceConnectorGroupRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; request.AddSubResource("operation", "associate-phone-numbers"); if (!publicRequest.IsSetVoiceConnectorGroupId()) throw new AmazonChimeException("Request object does not have required field VoiceConnectorGroupId set"); request.AddPathResource("{voiceConnectorGroupId}", StringUtils.FromString(publicRequest.VoiceConnectorGroupId)); request.ResourcePath = "/voice-connector-groups/{voiceConnectorGroupId}"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetE164PhoneNumbers()) { context.Writer.WritePropertyName("E164PhoneNumbers"); context.Writer.WriteArrayStart(); foreach(var publicRequestE164PhoneNumbersListValue in publicRequest.E164PhoneNumbers) { context.Writer.Write(publicRequestE164PhoneNumbersListValue); } context.Writer.WriteArrayEnd(); } if(publicRequest.IsSetForceAssociate()) { context.Writer.WritePropertyName("ForceAssociate"); context.Writer.Write(publicRequest.ForceAssociate); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static AssociatePhoneNumbersWithVoiceConnectorGroupRequestMarshaller _instance = new AssociatePhoneNumbersWithVoiceConnectorGroupRequestMarshaller(); internal static AssociatePhoneNumbersWithVoiceConnectorGroupRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static AssociatePhoneNumbersWithVoiceConnectorGroupRequestMarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for AssociatePhoneNumbersWithVoiceConnectorGroup operation /// </summary> public class AssociatePhoneNumbersWithVoiceConnectorGroupResponseUnmarshaller : 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) { AssociatePhoneNumbersWithVoiceConnectorGroupResponse response = new AssociatePhoneNumbersWithVoiceConnectorGroupResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("PhoneNumberErrors", targetDepth)) { var unmarshaller = new ListUnmarshaller<PhoneNumberError, PhoneNumberErrorUnmarshaller>(PhoneNumberErrorUnmarshaller.Instance); response.PhoneNumberErrors = 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("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.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("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static AssociatePhoneNumbersWithVoiceConnectorGroupResponseUnmarshaller _instance = new AssociatePhoneNumbersWithVoiceConnectorGroupResponseUnmarshaller(); internal static AssociatePhoneNumbersWithVoiceConnectorGroupResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static AssociatePhoneNumbersWithVoiceConnectorGroupResponseUnmarshaller Instance { get { return _instance; } } } }
138
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// AssociatePhoneNumbersWithVoiceConnector Request Marshaller /// </summary> public class AssociatePhoneNumbersWithVoiceConnectorRequestMarshaller : IMarshaller<IRequest, AssociatePhoneNumbersWithVoiceConnectorRequest> , 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((AssociatePhoneNumbersWithVoiceConnectorRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(AssociatePhoneNumbersWithVoiceConnectorRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; request.AddSubResource("operation", "associate-phone-numbers"); if (!publicRequest.IsSetVoiceConnectorId()) throw new AmazonChimeException("Request object does not have required field VoiceConnectorId set"); request.AddPathResource("{voiceConnectorId}", StringUtils.FromString(publicRequest.VoiceConnectorId)); request.ResourcePath = "/voice-connectors/{voiceConnectorId}"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetE164PhoneNumbers()) { context.Writer.WritePropertyName("E164PhoneNumbers"); context.Writer.WriteArrayStart(); foreach(var publicRequestE164PhoneNumbersListValue in publicRequest.E164PhoneNumbers) { context.Writer.Write(publicRequestE164PhoneNumbersListValue); } context.Writer.WriteArrayEnd(); } if(publicRequest.IsSetForceAssociate()) { context.Writer.WritePropertyName("ForceAssociate"); context.Writer.Write(publicRequest.ForceAssociate); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static AssociatePhoneNumbersWithVoiceConnectorRequestMarshaller _instance = new AssociatePhoneNumbersWithVoiceConnectorRequestMarshaller(); internal static AssociatePhoneNumbersWithVoiceConnectorRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static AssociatePhoneNumbersWithVoiceConnectorRequestMarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for AssociatePhoneNumbersWithVoiceConnector operation /// </summary> public class AssociatePhoneNumbersWithVoiceConnectorResponseUnmarshaller : 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) { AssociatePhoneNumbersWithVoiceConnectorResponse response = new AssociatePhoneNumbersWithVoiceConnectorResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("PhoneNumberErrors", targetDepth)) { var unmarshaller = new ListUnmarshaller<PhoneNumberError, PhoneNumberErrorUnmarshaller>(PhoneNumberErrorUnmarshaller.Instance); response.PhoneNumberErrors = 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("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.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("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static AssociatePhoneNumbersWithVoiceConnectorResponseUnmarshaller _instance = new AssociatePhoneNumbersWithVoiceConnectorResponseUnmarshaller(); internal static AssociatePhoneNumbersWithVoiceConnectorResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static AssociatePhoneNumbersWithVoiceConnectorResponseUnmarshaller Instance { get { return _instance; } } } }
138
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// AssociatePhoneNumberWithUser Request Marshaller /// </summary> public class AssociatePhoneNumberWithUserRequestMarshaller : IMarshaller<IRequest, AssociatePhoneNumberWithUserRequest> , 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((AssociatePhoneNumberWithUserRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(AssociatePhoneNumberWithUserRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; request.AddSubResource("operation", "associate-phone-number"); if (!publicRequest.IsSetAccountId()) throw new AmazonChimeException("Request object does not have required field AccountId set"); request.AddPathResource("{accountId}", StringUtils.FromString(publicRequest.AccountId)); if (!publicRequest.IsSetUserId()) throw new AmazonChimeException("Request object does not have required field UserId set"); request.AddPathResource("{userId}", StringUtils.FromString(publicRequest.UserId)); request.ResourcePath = "/accounts/{accountId}/users/{userId}"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetE164PhoneNumber()) { context.Writer.WritePropertyName("E164PhoneNumber"); context.Writer.Write(publicRequest.E164PhoneNumber); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static AssociatePhoneNumberWithUserRequestMarshaller _instance = new AssociatePhoneNumberWithUserRequestMarshaller(); internal static AssociatePhoneNumberWithUserRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static AssociatePhoneNumberWithUserRequestMarshaller Instance { get { return _instance; } } } }
108
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for AssociatePhoneNumberWithUser operation /// </summary> public class AssociatePhoneNumberWithUserResponseUnmarshaller : 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) { AssociatePhoneNumberWithUserResponse response = new AssociatePhoneNumberWithUserResponse(); 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("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.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("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static AssociatePhoneNumberWithUserResponseUnmarshaller _instance = new AssociatePhoneNumberWithUserResponseUnmarshaller(); internal static AssociatePhoneNumberWithUserResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static AssociatePhoneNumberWithUserResponseUnmarshaller Instance { get { return _instance; } } } }
127
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// AssociateSigninDelegateGroupsWithAccount Request Marshaller /// </summary> public class AssociateSigninDelegateGroupsWithAccountRequestMarshaller : IMarshaller<IRequest, AssociateSigninDelegateGroupsWithAccountRequest> , 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((AssociateSigninDelegateGroupsWithAccountRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(AssociateSigninDelegateGroupsWithAccountRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; request.AddSubResource("operation", "associate-signin-delegate-groups"); if (!publicRequest.IsSetAccountId()) throw new AmazonChimeException("Request object does not have required field AccountId set"); request.AddPathResource("{accountId}", StringUtils.FromString(publicRequest.AccountId)); request.ResourcePath = "/accounts/{accountId}"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetSigninDelegateGroups()) { context.Writer.WritePropertyName("SigninDelegateGroups"); context.Writer.WriteArrayStart(); foreach(var publicRequestSigninDelegateGroupsListValue in publicRequest.SigninDelegateGroups) { context.Writer.WriteObjectStart(); var marshaller = SigninDelegateGroupMarshaller.Instance; marshaller.Marshall(publicRequestSigninDelegateGroupsListValue, 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 AssociateSigninDelegateGroupsWithAccountRequestMarshaller _instance = new AssociateSigninDelegateGroupsWithAccountRequestMarshaller(); internal static AssociateSigninDelegateGroupsWithAccountRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static AssociateSigninDelegateGroupsWithAccountRequestMarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for AssociateSigninDelegateGroupsWithAccount operation /// </summary> public class AssociateSigninDelegateGroupsWithAccountResponseUnmarshaller : 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) { AssociateSigninDelegateGroupsWithAccountResponse response = new AssociateSigninDelegateGroupsWithAccountResponse(); 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("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.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("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static AssociateSigninDelegateGroupsWithAccountResponseUnmarshaller _instance = new AssociateSigninDelegateGroupsWithAccountResponseUnmarshaller(); internal static AssociateSigninDelegateGroupsWithAccountResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static AssociateSigninDelegateGroupsWithAccountResponseUnmarshaller Instance { get { return _instance; } } } }
123
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for Attendee Object /// </summary> public class AttendeeUnmarshaller : IUnmarshaller<Attendee, XmlUnmarshallerContext>, IUnmarshaller<Attendee, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> Attendee IUnmarshaller<Attendee, 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 Attendee Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; Attendee unmarshalledObject = new Attendee(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("AttendeeId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.AttendeeId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ExternalUserId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ExternalUserId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("JoinToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.JoinToken = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static AttendeeUnmarshaller _instance = new AttendeeUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static AttendeeUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// AudioArtifactsConfiguration Marshaller /// </summary> public class AudioArtifactsConfigurationMarshaller : IRequestMarshaller<AudioArtifactsConfiguration, 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(AudioArtifactsConfiguration requestObject, JsonMarshallerContext context) { if(requestObject.IsSetMuxType()) { context.Writer.WritePropertyName("MuxType"); context.Writer.Write(requestObject.MuxType); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static AudioArtifactsConfigurationMarshaller Instance = new AudioArtifactsConfigurationMarshaller(); } }
62
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for AudioArtifactsConfiguration Object /// </summary> public class AudioArtifactsConfigurationUnmarshaller : IUnmarshaller<AudioArtifactsConfiguration, XmlUnmarshallerContext>, IUnmarshaller<AudioArtifactsConfiguration, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> AudioArtifactsConfiguration IUnmarshaller<AudioArtifactsConfiguration, 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 AudioArtifactsConfiguration Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; AudioArtifactsConfiguration unmarshalledObject = new AudioArtifactsConfiguration(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("MuxType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.MuxType = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static AudioArtifactsConfigurationUnmarshaller _instance = new AudioArtifactsConfigurationUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static AudioArtifactsConfigurationUnmarshaller Instance { get { return _instance; } } } }
92
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.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)) { if (context.TestExpression("Code", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Code = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static BadRequestExceptionUnmarshaller _instance = new BadRequestExceptionUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static BadRequestExceptionUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for BatchChannelMemberships Object /// </summary> public class BatchChannelMembershipsUnmarshaller : IUnmarshaller<BatchChannelMemberships, XmlUnmarshallerContext>, IUnmarshaller<BatchChannelMemberships, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> BatchChannelMemberships IUnmarshaller<BatchChannelMemberships, 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 BatchChannelMemberships Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; BatchChannelMemberships unmarshalledObject = new BatchChannelMemberships(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ChannelArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ChannelArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("InvitedBy", targetDepth)) { var unmarshaller = IdentityUnmarshaller.Instance; unmarshalledObject.InvitedBy = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Members", targetDepth)) { var unmarshaller = new ListUnmarshaller<Identity, IdentityUnmarshaller>(IdentityUnmarshaller.Instance); unmarshalledObject.Members = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Type", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Type = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static BatchChannelMembershipsUnmarshaller _instance = new BatchChannelMembershipsUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static BatchChannelMembershipsUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// BatchCreateAttendee Request Marshaller /// </summary> public class BatchCreateAttendeeRequestMarshaller : IMarshaller<IRequest, BatchCreateAttendeeRequest> , 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((BatchCreateAttendeeRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(BatchCreateAttendeeRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; request.AddSubResource("operation", "batch-create"); if (!publicRequest.IsSetMeetingId()) throw new AmazonChimeException("Request object does not have required field MeetingId set"); request.AddPathResource("{meetingId}", StringUtils.FromString(publicRequest.MeetingId)); request.ResourcePath = "/meetings/{meetingId}/attendees"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetAttendees()) { context.Writer.WritePropertyName("Attendees"); context.Writer.WriteArrayStart(); foreach(var publicRequestAttendeesListValue in publicRequest.Attendees) { context.Writer.WriteObjectStart(); var marshaller = CreateAttendeeRequestItemMarshaller.Instance; marshaller.Marshall(publicRequestAttendeesListValue, 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 BatchCreateAttendeeRequestMarshaller _instance = new BatchCreateAttendeeRequestMarshaller(); internal static BatchCreateAttendeeRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static BatchCreateAttendeeRequestMarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for BatchCreateAttendee operation /// </summary> public class BatchCreateAttendeeResponseUnmarshaller : 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) { BatchCreateAttendeeResponse response = new BatchCreateAttendeeResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Attendees", targetDepth)) { var unmarshaller = new ListUnmarshaller<Attendee, AttendeeUnmarshaller>(AttendeeUnmarshaller.Instance); response.Attendees = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Errors", targetDepth)) { var unmarshaller = new ListUnmarshaller<CreateAttendeeError, CreateAttendeeErrorUnmarshaller>(CreateAttendeeErrorUnmarshaller.Instance); response.Errors = 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("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.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("ResourceLimitExceededException")) { return ResourceLimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static BatchCreateAttendeeResponseUnmarshaller _instance = new BatchCreateAttendeeResponseUnmarshaller(); internal static BatchCreateAttendeeResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static BatchCreateAttendeeResponseUnmarshaller Instance { get { return _instance; } } } }
144
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for BatchCreateChannelMembershipError Object /// </summary> public class BatchCreateChannelMembershipErrorUnmarshaller : IUnmarshaller<BatchCreateChannelMembershipError, XmlUnmarshallerContext>, IUnmarshaller<BatchCreateChannelMembershipError, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> BatchCreateChannelMembershipError IUnmarshaller<BatchCreateChannelMembershipError, 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 BatchCreateChannelMembershipError Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; BatchCreateChannelMembershipError unmarshalledObject = new BatchCreateChannelMembershipError(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ErrorCode", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ErrorCode = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ErrorMessage", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ErrorMessage = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("MemberArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.MemberArn = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static BatchCreateChannelMembershipErrorUnmarshaller _instance = new BatchCreateChannelMembershipErrorUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static BatchCreateChannelMembershipErrorUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// BatchCreateChannelMembership Request Marshaller /// </summary> public class BatchCreateChannelMembershipRequestMarshaller : IMarshaller<IRequest, BatchCreateChannelMembershipRequest> , 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((BatchCreateChannelMembershipRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(BatchCreateChannelMembershipRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; request.AddSubResource("operation", "batch-create"); if (!publicRequest.IsSetChannelArn()) throw new AmazonChimeException("Request object does not have required field ChannelArn set"); request.AddPathResource("{channelArn}", StringUtils.FromString(publicRequest.ChannelArn)); request.ResourcePath = "/channels/{channelArn}/memberships"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetMemberArns()) { context.Writer.WritePropertyName("MemberArns"); context.Writer.WriteArrayStart(); foreach(var publicRequestMemberArnsListValue in publicRequest.MemberArns) { context.Writer.Write(publicRequestMemberArnsListValue); } context.Writer.WriteArrayEnd(); } if(publicRequest.IsSetType()) { context.Writer.WritePropertyName("Type"); context.Writer.Write(publicRequest.Type); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } if (publicRequest.IsSetChimeBearer()) { request.Headers["x-amz-chime-bearer"] = publicRequest.ChimeBearer; } request.HostPrefix = $"messaging-"; return request; } private static BatchCreateChannelMembershipRequestMarshaller _instance = new BatchCreateChannelMembershipRequestMarshaller(); internal static BatchCreateChannelMembershipRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static BatchCreateChannelMembershipRequestMarshaller Instance { get { return _instance; } } } }
123
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for BatchCreateChannelMembership operation /// </summary> public class BatchCreateChannelMembershipResponseUnmarshaller : 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) { BatchCreateChannelMembershipResponse response = new BatchCreateChannelMembershipResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("BatchChannelMemberships", targetDepth)) { var unmarshaller = BatchChannelMembershipsUnmarshaller.Instance; response.BatchChannelMemberships = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Errors", targetDepth)) { var unmarshaller = new ListUnmarshaller<BatchCreateChannelMembershipError, BatchCreateChannelMembershipErrorUnmarshaller>(BatchCreateChannelMembershipErrorUnmarshaller.Instance); response.Errors = 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("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static BatchCreateChannelMembershipResponseUnmarshaller _instance = new BatchCreateChannelMembershipResponseUnmarshaller(); internal static BatchCreateChannelMembershipResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static BatchCreateChannelMembershipResponseUnmarshaller Instance { get { return _instance; } } } }
136
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// BatchCreateRoomMembership Request Marshaller /// </summary> public class BatchCreateRoomMembershipRequestMarshaller : IMarshaller<IRequest, BatchCreateRoomMembershipRequest> , 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((BatchCreateRoomMembershipRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(BatchCreateRoomMembershipRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; request.AddSubResource("operation", "batch-create"); if (!publicRequest.IsSetAccountId()) throw new AmazonChimeException("Request object does not have required field AccountId set"); request.AddPathResource("{accountId}", StringUtils.FromString(publicRequest.AccountId)); if (!publicRequest.IsSetRoomId()) throw new AmazonChimeException("Request object does not have required field RoomId set"); request.AddPathResource("{roomId}", StringUtils.FromString(publicRequest.RoomId)); request.ResourcePath = "/accounts/{accountId}/rooms/{roomId}/memberships"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetMembershipItemList()) { context.Writer.WritePropertyName("MembershipItemList"); context.Writer.WriteArrayStart(); foreach(var publicRequestMembershipItemListListValue in publicRequest.MembershipItemList) { context.Writer.WriteObjectStart(); var marshaller = MembershipItemMarshaller.Instance; marshaller.Marshall(publicRequestMembershipItemListListValue, 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 BatchCreateRoomMembershipRequestMarshaller _instance = new BatchCreateRoomMembershipRequestMarshaller(); internal static BatchCreateRoomMembershipRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static BatchCreateRoomMembershipRequestMarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for BatchCreateRoomMembership operation /// </summary> public class BatchCreateRoomMembershipResponseUnmarshaller : 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) { BatchCreateRoomMembershipResponse response = new BatchCreateRoomMembershipResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Errors", targetDepth)) { var unmarshaller = new ListUnmarshaller<MemberError, MemberErrorUnmarshaller>(MemberErrorUnmarshaller.Instance); response.Errors = 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("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.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("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static BatchCreateRoomMembershipResponseUnmarshaller _instance = new BatchCreateRoomMembershipResponseUnmarshaller(); internal static BatchCreateRoomMembershipResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static BatchCreateRoomMembershipResponseUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// BatchDeletePhoneNumber Request Marshaller /// </summary> public class BatchDeletePhoneNumberRequestMarshaller : IMarshaller<IRequest, BatchDeletePhoneNumberRequest> , 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((BatchDeletePhoneNumberRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(BatchDeletePhoneNumberRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; request.AddSubResource("operation", "batch-delete"); request.ResourcePath = "/phone-numbers"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetPhoneNumberIds()) { context.Writer.WritePropertyName("PhoneNumberIds"); context.Writer.WriteArrayStart(); foreach(var publicRequestPhoneNumberIdsListValue in publicRequest.PhoneNumberIds) { context.Writer.Write(publicRequestPhoneNumberIdsListValue); } context.Writer.WriteArrayEnd(); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static BatchDeletePhoneNumberRequestMarshaller _instance = new BatchDeletePhoneNumberRequestMarshaller(); internal static BatchDeletePhoneNumberRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static BatchDeletePhoneNumberRequestMarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for BatchDeletePhoneNumber operation /// </summary> public class BatchDeletePhoneNumberResponseUnmarshaller : 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) { BatchDeletePhoneNumberResponse response = new BatchDeletePhoneNumberResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("PhoneNumberErrors", targetDepth)) { var unmarshaller = new ListUnmarshaller<PhoneNumberError, PhoneNumberErrorUnmarshaller>(PhoneNumberErrorUnmarshaller.Instance); response.PhoneNumberErrors = 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("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.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("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static BatchDeletePhoneNumberResponseUnmarshaller _instance = new BatchDeletePhoneNumberResponseUnmarshaller(); internal static BatchDeletePhoneNumberResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static BatchDeletePhoneNumberResponseUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// BatchSuspendUser Request Marshaller /// </summary> public class BatchSuspendUserRequestMarshaller : IMarshaller<IRequest, BatchSuspendUserRequest> , 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((BatchSuspendUserRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(BatchSuspendUserRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; request.AddSubResource("operation", "suspend"); if (!publicRequest.IsSetAccountId()) throw new AmazonChimeException("Request object does not have required field AccountId set"); request.AddPathResource("{accountId}", StringUtils.FromString(publicRequest.AccountId)); request.ResourcePath = "/accounts/{accountId}/users"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetUserIdList()) { context.Writer.WritePropertyName("UserIdList"); context.Writer.WriteArrayStart(); foreach(var publicRequestUserIdListListValue in publicRequest.UserIdList) { context.Writer.Write(publicRequestUserIdListListValue); } context.Writer.WriteArrayEnd(); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static BatchSuspendUserRequestMarshaller _instance = new BatchSuspendUserRequestMarshaller(); internal static BatchSuspendUserRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static BatchSuspendUserRequestMarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for BatchSuspendUser operation /// </summary> public class BatchSuspendUserResponseUnmarshaller : 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) { BatchSuspendUserResponse response = new BatchSuspendUserResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("UserErrors", targetDepth)) { var unmarshaller = new ListUnmarshaller<UserError, UserErrorUnmarshaller>(UserErrorUnmarshaller.Instance); response.UserErrors = 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("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.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("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static BatchSuspendUserResponseUnmarshaller _instance = new BatchSuspendUserResponseUnmarshaller(); internal static BatchSuspendUserResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static BatchSuspendUserResponseUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// BatchUnsuspendUser Request Marshaller /// </summary> public class BatchUnsuspendUserRequestMarshaller : IMarshaller<IRequest, BatchUnsuspendUserRequest> , 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((BatchUnsuspendUserRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(BatchUnsuspendUserRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; request.AddSubResource("operation", "unsuspend"); if (!publicRequest.IsSetAccountId()) throw new AmazonChimeException("Request object does not have required field AccountId set"); request.AddPathResource("{accountId}", StringUtils.FromString(publicRequest.AccountId)); request.ResourcePath = "/accounts/{accountId}/users"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetUserIdList()) { context.Writer.WritePropertyName("UserIdList"); context.Writer.WriteArrayStart(); foreach(var publicRequestUserIdListListValue in publicRequest.UserIdList) { context.Writer.Write(publicRequestUserIdListListValue); } context.Writer.WriteArrayEnd(); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static BatchUnsuspendUserRequestMarshaller _instance = new BatchUnsuspendUserRequestMarshaller(); internal static BatchUnsuspendUserRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static BatchUnsuspendUserRequestMarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for BatchUnsuspendUser operation /// </summary> public class BatchUnsuspendUserResponseUnmarshaller : 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) { BatchUnsuspendUserResponse response = new BatchUnsuspendUserResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("UserErrors", targetDepth)) { var unmarshaller = new ListUnmarshaller<UserError, UserErrorUnmarshaller>(UserErrorUnmarshaller.Instance); response.UserErrors = 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("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.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("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static BatchUnsuspendUserResponseUnmarshaller _instance = new BatchUnsuspendUserResponseUnmarshaller(); internal static BatchUnsuspendUserResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static BatchUnsuspendUserResponseUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// BatchUpdatePhoneNumber Request Marshaller /// </summary> public class BatchUpdatePhoneNumberRequestMarshaller : IMarshaller<IRequest, BatchUpdatePhoneNumberRequest> , 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((BatchUpdatePhoneNumberRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(BatchUpdatePhoneNumberRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; request.AddSubResource("operation", "batch-update"); request.ResourcePath = "/phone-numbers"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetUpdatePhoneNumberRequestItems()) { context.Writer.WritePropertyName("UpdatePhoneNumberRequestItems"); context.Writer.WriteArrayStart(); foreach(var publicRequestUpdatePhoneNumberRequestItemsListValue in publicRequest.UpdatePhoneNumberRequestItems) { context.Writer.WriteObjectStart(); var marshaller = UpdatePhoneNumberRequestItemMarshaller.Instance; marshaller.Marshall(publicRequestUpdatePhoneNumberRequestItemsListValue, 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 BatchUpdatePhoneNumberRequestMarshaller _instance = new BatchUpdatePhoneNumberRequestMarshaller(); internal static BatchUpdatePhoneNumberRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static BatchUpdatePhoneNumberRequestMarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for BatchUpdatePhoneNumber operation /// </summary> public class BatchUpdatePhoneNumberResponseUnmarshaller : 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) { BatchUpdatePhoneNumberResponse response = new BatchUpdatePhoneNumberResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("PhoneNumberErrors", targetDepth)) { var unmarshaller = new ListUnmarshaller<PhoneNumberError, PhoneNumberErrorUnmarshaller>(PhoneNumberErrorUnmarshaller.Instance); response.PhoneNumberErrors = 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("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.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("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static BatchUpdatePhoneNumberResponseUnmarshaller _instance = new BatchUpdatePhoneNumberResponseUnmarshaller(); internal static BatchUpdatePhoneNumberResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static BatchUpdatePhoneNumberResponseUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// BatchUpdateUser Request Marshaller /// </summary> public class BatchUpdateUserRequestMarshaller : IMarshaller<IRequest, BatchUpdateUserRequest> , 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((BatchUpdateUserRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(BatchUpdateUserRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; if (!publicRequest.IsSetAccountId()) throw new AmazonChimeException("Request object does not have required field AccountId set"); request.AddPathResource("{accountId}", StringUtils.FromString(publicRequest.AccountId)); request.ResourcePath = "/accounts/{accountId}/users"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetUpdateUserRequestItems()) { context.Writer.WritePropertyName("UpdateUserRequestItems"); context.Writer.WriteArrayStart(); foreach(var publicRequestUpdateUserRequestItemsListValue in publicRequest.UpdateUserRequestItems) { context.Writer.WriteObjectStart(); var marshaller = UpdateUserRequestItemMarshaller.Instance; marshaller.Marshall(publicRequestUpdateUserRequestItemsListValue, 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 BatchUpdateUserRequestMarshaller _instance = new BatchUpdateUserRequestMarshaller(); internal static BatchUpdateUserRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static BatchUpdateUserRequestMarshaller Instance { get { return _instance; } } } }
114
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for BatchUpdateUser operation /// </summary> public class BatchUpdateUserResponseUnmarshaller : 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) { BatchUpdateUserResponse response = new BatchUpdateUserResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("UserErrors", targetDepth)) { var unmarshaller = new ListUnmarshaller<UserError, UserErrorUnmarshaller>(UserErrorUnmarshaller.Instance); response.UserErrors = 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("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.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("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static BatchUpdateUserResponseUnmarshaller _instance = new BatchUpdateUserResponseUnmarshaller(); internal static BatchUpdateUserResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static BatchUpdateUserResponseUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for Bot Object /// </summary> public class BotUnmarshaller : IUnmarshaller<Bot, XmlUnmarshallerContext>, IUnmarshaller<Bot, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> Bot IUnmarshaller<Bot, 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 Bot Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; Bot unmarshalledObject = new Bot(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("BotEmail", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.BotEmail = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BotId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.BotId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BotType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.BotType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreatedTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.CreatedTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Disabled", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; unmarshalledObject.Disabled = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("DisplayName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.DisplayName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("SecurityToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.SecurityToken = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("UpdatedTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.UpdatedTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("UserId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.UserId = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static BotUnmarshaller _instance = new BotUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static BotUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// BusinessCallingSettings Marshaller /// </summary> public class BusinessCallingSettingsMarshaller : IRequestMarshaller<BusinessCallingSettings, 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(BusinessCallingSettings requestObject, JsonMarshallerContext context) { if(requestObject.IsSetCdrBucket()) { context.Writer.WritePropertyName("CdrBucket"); context.Writer.Write(requestObject.CdrBucket); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static BusinessCallingSettingsMarshaller Instance = new BusinessCallingSettingsMarshaller(); } }
62
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for BusinessCallingSettings Object /// </summary> public class BusinessCallingSettingsUnmarshaller : IUnmarshaller<BusinessCallingSettings, XmlUnmarshallerContext>, IUnmarshaller<BusinessCallingSettings, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> BusinessCallingSettings IUnmarshaller<BusinessCallingSettings, 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 BusinessCallingSettings Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; BusinessCallingSettings unmarshalledObject = new BusinessCallingSettings(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("CdrBucket", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.CdrBucket = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static BusinessCallingSettingsUnmarshaller _instance = new BusinessCallingSettingsUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static BusinessCallingSettingsUnmarshaller Instance { get { return _instance; } } } }
92
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CandidateAddress Object /// </summary> public class CandidateAddressUnmarshaller : IUnmarshaller<CandidateAddress, XmlUnmarshallerContext>, IUnmarshaller<CandidateAddress, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> CandidateAddress IUnmarshaller<CandidateAddress, 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 CandidateAddress Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; CandidateAddress unmarshalledObject = new CandidateAddress(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("city", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.City = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("country", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Country = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("postalCode", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.PostalCode = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("postalCodePlus4", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.PostalCodePlus4 = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("state", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.State = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("streetInfo", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.StreetInfo = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("streetNumber", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.StreetNumber = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static CandidateAddressUnmarshaller _instance = new CandidateAddressUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static CandidateAddressUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ChannelBanSummary Object /// </summary> public class ChannelBanSummaryUnmarshaller : IUnmarshaller<ChannelBanSummary, XmlUnmarshallerContext>, IUnmarshaller<ChannelBanSummary, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> ChannelBanSummary IUnmarshaller<ChannelBanSummary, 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 ChannelBanSummary Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; ChannelBanSummary unmarshalledObject = new ChannelBanSummary(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Member", targetDepth)) { var unmarshaller = IdentityUnmarshaller.Instance; unmarshalledObject.Member = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static ChannelBanSummaryUnmarshaller _instance = new ChannelBanSummaryUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ChannelBanSummaryUnmarshaller Instance { get { return _instance; } } } }
92
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ChannelBan Object /// </summary> public class ChannelBanUnmarshaller : IUnmarshaller<ChannelBan, XmlUnmarshallerContext>, IUnmarshaller<ChannelBan, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> ChannelBan IUnmarshaller<ChannelBan, 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 ChannelBan Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; ChannelBan unmarshalledObject = new ChannelBan(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ChannelArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ChannelArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreatedBy", targetDepth)) { var unmarshaller = IdentityUnmarshaller.Instance; unmarshalledObject.CreatedBy = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreatedTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.CreatedTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Member", targetDepth)) { var unmarshaller = IdentityUnmarshaller.Instance; unmarshalledObject.Member = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static ChannelBanUnmarshaller _instance = new ChannelBanUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ChannelBanUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ChannelMembershipForAppInstanceUserSummary Object /// </summary> public class ChannelMembershipForAppInstanceUserSummaryUnmarshaller : IUnmarshaller<ChannelMembershipForAppInstanceUserSummary, XmlUnmarshallerContext>, IUnmarshaller<ChannelMembershipForAppInstanceUserSummary, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> ChannelMembershipForAppInstanceUserSummary IUnmarshaller<ChannelMembershipForAppInstanceUserSummary, 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 ChannelMembershipForAppInstanceUserSummary Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; ChannelMembershipForAppInstanceUserSummary unmarshalledObject = new ChannelMembershipForAppInstanceUserSummary(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("AppInstanceUserMembershipSummary", targetDepth)) { var unmarshaller = AppInstanceUserMembershipSummaryUnmarshaller.Instance; unmarshalledObject.AppInstanceUserMembershipSummary = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ChannelSummary", targetDepth)) { var unmarshaller = ChannelSummaryUnmarshaller.Instance; unmarshalledObject.ChannelSummary = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static ChannelMembershipForAppInstanceUserSummaryUnmarshaller _instance = new ChannelMembershipForAppInstanceUserSummaryUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ChannelMembershipForAppInstanceUserSummaryUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ChannelMembershipSummary Object /// </summary> public class ChannelMembershipSummaryUnmarshaller : IUnmarshaller<ChannelMembershipSummary, XmlUnmarshallerContext>, IUnmarshaller<ChannelMembershipSummary, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> ChannelMembershipSummary IUnmarshaller<ChannelMembershipSummary, 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 ChannelMembershipSummary Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; ChannelMembershipSummary unmarshalledObject = new ChannelMembershipSummary(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Member", targetDepth)) { var unmarshaller = IdentityUnmarshaller.Instance; unmarshalledObject.Member = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static ChannelMembershipSummaryUnmarshaller _instance = new ChannelMembershipSummaryUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ChannelMembershipSummaryUnmarshaller Instance { get { return _instance; } } } }
92
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ChannelMembership Object /// </summary> public class ChannelMembershipUnmarshaller : IUnmarshaller<ChannelMembership, XmlUnmarshallerContext>, IUnmarshaller<ChannelMembership, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> ChannelMembership IUnmarshaller<ChannelMembership, 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 ChannelMembership Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; ChannelMembership unmarshalledObject = new ChannelMembership(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ChannelArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ChannelArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreatedTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.CreatedTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("InvitedBy", targetDepth)) { var unmarshaller = IdentityUnmarshaller.Instance; unmarshalledObject.InvitedBy = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LastUpdatedTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.LastUpdatedTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Member", targetDepth)) { var unmarshaller = IdentityUnmarshaller.Instance; unmarshalledObject.Member = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Type", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Type = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static ChannelMembershipUnmarshaller _instance = new ChannelMembershipUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ChannelMembershipUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ChannelMessageSummary Object /// </summary> public class ChannelMessageSummaryUnmarshaller : IUnmarshaller<ChannelMessageSummary, XmlUnmarshallerContext>, IUnmarshaller<ChannelMessageSummary, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> ChannelMessageSummary IUnmarshaller<ChannelMessageSummary, 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 ChannelMessageSummary Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; ChannelMessageSummary unmarshalledObject = new ChannelMessageSummary(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Content", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Content = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreatedTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.CreatedTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LastEditedTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.LastEditedTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LastUpdatedTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.LastUpdatedTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("MessageId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.MessageId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Metadata", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Metadata = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Redacted", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; unmarshalledObject.Redacted = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Sender", targetDepth)) { var unmarshaller = IdentityUnmarshaller.Instance; unmarshalledObject.Sender = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Type", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Type = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static ChannelMessageSummaryUnmarshaller _instance = new ChannelMessageSummaryUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ChannelMessageSummaryUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ChannelMessage Object /// </summary> public class ChannelMessageUnmarshaller : IUnmarshaller<ChannelMessage, XmlUnmarshallerContext>, IUnmarshaller<ChannelMessage, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> ChannelMessage IUnmarshaller<ChannelMessage, 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 ChannelMessage Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; ChannelMessage unmarshalledObject = new ChannelMessage(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ChannelArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ChannelArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Content", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Content = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreatedTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.CreatedTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LastEditedTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.LastEditedTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LastUpdatedTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.LastUpdatedTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("MessageId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.MessageId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Metadata", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Metadata = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Persistence", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Persistence = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Redacted", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; unmarshalledObject.Redacted = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Sender", targetDepth)) { var unmarshaller = IdentityUnmarshaller.Instance; unmarshalledObject.Sender = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Type", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Type = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static ChannelMessageUnmarshaller _instance = new ChannelMessageUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ChannelMessageUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ChannelModeratedByAppInstanceUserSummary Object /// </summary> public class ChannelModeratedByAppInstanceUserSummaryUnmarshaller : IUnmarshaller<ChannelModeratedByAppInstanceUserSummary, XmlUnmarshallerContext>, IUnmarshaller<ChannelModeratedByAppInstanceUserSummary, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> ChannelModeratedByAppInstanceUserSummary IUnmarshaller<ChannelModeratedByAppInstanceUserSummary, 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 ChannelModeratedByAppInstanceUserSummary Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; ChannelModeratedByAppInstanceUserSummary unmarshalledObject = new ChannelModeratedByAppInstanceUserSummary(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ChannelSummary", targetDepth)) { var unmarshaller = ChannelSummaryUnmarshaller.Instance; unmarshalledObject.ChannelSummary = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static ChannelModeratedByAppInstanceUserSummaryUnmarshaller _instance = new ChannelModeratedByAppInstanceUserSummaryUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ChannelModeratedByAppInstanceUserSummaryUnmarshaller Instance { get { return _instance; } } } }
92
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ChannelModeratorSummary Object /// </summary> public class ChannelModeratorSummaryUnmarshaller : IUnmarshaller<ChannelModeratorSummary, XmlUnmarshallerContext>, IUnmarshaller<ChannelModeratorSummary, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> ChannelModeratorSummary IUnmarshaller<ChannelModeratorSummary, 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 ChannelModeratorSummary Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; ChannelModeratorSummary unmarshalledObject = new ChannelModeratorSummary(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Moderator", targetDepth)) { var unmarshaller = IdentityUnmarshaller.Instance; unmarshalledObject.Moderator = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static ChannelModeratorSummaryUnmarshaller _instance = new ChannelModeratorSummaryUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ChannelModeratorSummaryUnmarshaller Instance { get { return _instance; } } } }
92
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ChannelModerator Object /// </summary> public class ChannelModeratorUnmarshaller : IUnmarshaller<ChannelModerator, XmlUnmarshallerContext>, IUnmarshaller<ChannelModerator, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> ChannelModerator IUnmarshaller<ChannelModerator, 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 ChannelModerator Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; ChannelModerator unmarshalledObject = new ChannelModerator(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ChannelArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ChannelArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreatedBy", targetDepth)) { var unmarshaller = IdentityUnmarshaller.Instance; unmarshalledObject.CreatedBy = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreatedTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.CreatedTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Moderator", targetDepth)) { var unmarshaller = IdentityUnmarshaller.Instance; unmarshalledObject.Moderator = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static ChannelModeratorUnmarshaller _instance = new ChannelModeratorUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ChannelModeratorUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// ChannelRetentionSettings Marshaller /// </summary> public class ChannelRetentionSettingsMarshaller : IRequestMarshaller<ChannelRetentionSettings, 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(ChannelRetentionSettings requestObject, JsonMarshallerContext context) { if(requestObject.IsSetRetentionDays()) { context.Writer.WritePropertyName("RetentionDays"); context.Writer.Write(requestObject.RetentionDays); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static ChannelRetentionSettingsMarshaller Instance = new ChannelRetentionSettingsMarshaller(); } }
62
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ChannelRetentionSettings Object /// </summary> public class ChannelRetentionSettingsUnmarshaller : IUnmarshaller<ChannelRetentionSettings, XmlUnmarshallerContext>, IUnmarshaller<ChannelRetentionSettings, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> ChannelRetentionSettings IUnmarshaller<ChannelRetentionSettings, 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 ChannelRetentionSettings Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; ChannelRetentionSettings unmarshalledObject = new ChannelRetentionSettings(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("RetentionDays", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; unmarshalledObject.RetentionDays = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static ChannelRetentionSettingsUnmarshaller _instance = new ChannelRetentionSettingsUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ChannelRetentionSettingsUnmarshaller Instance { get { return _instance; } } } }
92
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ChannelSummary Object /// </summary> public class ChannelSummaryUnmarshaller : IUnmarshaller<ChannelSummary, XmlUnmarshallerContext>, IUnmarshaller<ChannelSummary, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> ChannelSummary IUnmarshaller<ChannelSummary, 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 ChannelSummary Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; ChannelSummary unmarshalledObject = new ChannelSummary(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ChannelArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ChannelArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LastMessageTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.LastMessageTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Metadata", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Metadata = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Mode", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Mode = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Name", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Name = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Privacy", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Privacy = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static ChannelSummaryUnmarshaller _instance = new ChannelSummaryUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ChannelSummaryUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for Channel Object /// </summary> public class ChannelUnmarshaller : IUnmarshaller<Channel, XmlUnmarshallerContext>, IUnmarshaller<Channel, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> Channel IUnmarshaller<Channel, 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 Channel Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; Channel unmarshalledObject = new Channel(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ChannelArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ChannelArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreatedBy", targetDepth)) { var unmarshaller = IdentityUnmarshaller.Instance; unmarshalledObject.CreatedBy = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreatedTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.CreatedTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LastMessageTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.LastMessageTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LastUpdatedTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.LastUpdatedTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Metadata", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Metadata = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Mode", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Mode = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Name", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Name = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Privacy", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Privacy = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static ChannelUnmarshaller _instance = new ChannelUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ChannelUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// ChimeSdkMeetingConfiguration Marshaller /// </summary> public class ChimeSdkMeetingConfigurationMarshaller : IRequestMarshaller<ChimeSdkMeetingConfiguration, 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(ChimeSdkMeetingConfiguration requestObject, JsonMarshallerContext context) { if(requestObject.IsSetArtifactsConfiguration()) { context.Writer.WritePropertyName("ArtifactsConfiguration"); context.Writer.WriteObjectStart(); var marshaller = ArtifactsConfigurationMarshaller.Instance; marshaller.Marshall(requestObject.ArtifactsConfiguration, context); context.Writer.WriteObjectEnd(); } if(requestObject.IsSetSourceConfiguration()) { context.Writer.WritePropertyName("SourceConfiguration"); context.Writer.WriteObjectStart(); var marshaller = SourceConfigurationMarshaller.Instance; marshaller.Marshall(requestObject.SourceConfiguration, context); context.Writer.WriteObjectEnd(); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static ChimeSdkMeetingConfigurationMarshaller Instance = new ChimeSdkMeetingConfigurationMarshaller(); } }
78
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ChimeSdkMeetingConfiguration Object /// </summary> public class ChimeSdkMeetingConfigurationUnmarshaller : IUnmarshaller<ChimeSdkMeetingConfiguration, XmlUnmarshallerContext>, IUnmarshaller<ChimeSdkMeetingConfiguration, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> ChimeSdkMeetingConfiguration IUnmarshaller<ChimeSdkMeetingConfiguration, 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 ChimeSdkMeetingConfiguration Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; ChimeSdkMeetingConfiguration unmarshalledObject = new ChimeSdkMeetingConfiguration(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ArtifactsConfiguration", targetDepth)) { var unmarshaller = ArtifactsConfigurationUnmarshaller.Instance; unmarshalledObject.ArtifactsConfiguration = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("SourceConfiguration", targetDepth)) { var unmarshaller = SourceConfigurationUnmarshaller.Instance; unmarshalledObject.SourceConfiguration = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static ChimeSdkMeetingConfigurationUnmarshaller _instance = new ChimeSdkMeetingConfigurationUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ChimeSdkMeetingConfigurationUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ConflictException Object /// </summary> public class ConflictExceptionUnmarshaller : IErrorResponseUnmarshaller<ConflictException, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public ConflictException 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 ConflictException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse) { context.Read(); ConflictException unmarshalledObject = new ConflictException(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 ConflictExceptionUnmarshaller _instance = new ConflictExceptionUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ConflictExceptionUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// ContentArtifactsConfiguration Marshaller /// </summary> public class ContentArtifactsConfigurationMarshaller : IRequestMarshaller<ContentArtifactsConfiguration, 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(ContentArtifactsConfiguration requestObject, JsonMarshallerContext context) { if(requestObject.IsSetMuxType()) { context.Writer.WritePropertyName("MuxType"); context.Writer.Write(requestObject.MuxType); } if(requestObject.IsSetState()) { context.Writer.WritePropertyName("State"); context.Writer.Write(requestObject.State); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static ContentArtifactsConfigurationMarshaller Instance = new ContentArtifactsConfigurationMarshaller(); } }
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ContentArtifactsConfiguration Object /// </summary> public class ContentArtifactsConfigurationUnmarshaller : IUnmarshaller<ContentArtifactsConfiguration, XmlUnmarshallerContext>, IUnmarshaller<ContentArtifactsConfiguration, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> ContentArtifactsConfiguration IUnmarshaller<ContentArtifactsConfiguration, 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 ContentArtifactsConfiguration Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; ContentArtifactsConfiguration unmarshalledObject = new ContentArtifactsConfiguration(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("MuxType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.MuxType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("State", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.State = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static ContentArtifactsConfigurationUnmarshaller _instance = new ContentArtifactsConfigurationUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ContentArtifactsConfigurationUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// ConversationRetentionSettings Marshaller /// </summary> public class ConversationRetentionSettingsMarshaller : IRequestMarshaller<ConversationRetentionSettings, 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(ConversationRetentionSettings requestObject, JsonMarshallerContext context) { if(requestObject.IsSetRetentionDays()) { context.Writer.WritePropertyName("RetentionDays"); context.Writer.Write(requestObject.RetentionDays); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static ConversationRetentionSettingsMarshaller Instance = new ConversationRetentionSettingsMarshaller(); } }
62
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ConversationRetentionSettings Object /// </summary> public class ConversationRetentionSettingsUnmarshaller : IUnmarshaller<ConversationRetentionSettings, XmlUnmarshallerContext>, IUnmarshaller<ConversationRetentionSettings, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> ConversationRetentionSettings IUnmarshaller<ConversationRetentionSettings, 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 ConversationRetentionSettings Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; ConversationRetentionSettings unmarshalledObject = new ConversationRetentionSettings(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("RetentionDays", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; unmarshalledObject.RetentionDays = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static ConversationRetentionSettingsUnmarshaller _instance = new ConversationRetentionSettingsUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ConversationRetentionSettingsUnmarshaller Instance { get { return _instance; } } } }
92
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// CreateAccount Request Marshaller /// </summary> public class CreateAccountRequestMarshaller : IMarshaller<IRequest, CreateAccountRequest> , 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((CreateAccountRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateAccountRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; request.ResourcePath = "/accounts"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetName()) { context.Writer.WritePropertyName("Name"); context.Writer.Write(publicRequest.Name); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static CreateAccountRequestMarshaller _instance = new CreateAccountRequestMarshaller(); internal static CreateAccountRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateAccountRequestMarshaller Instance { get { return _instance; } } } }
101
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateAccount operation /// </summary> public class CreateAccountResponseUnmarshaller : 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) { CreateAccountResponse response = new CreateAccountResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Account", targetDepth)) { var unmarshaller = AccountUnmarshaller.Instance; response.Account = 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("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.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("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateAccountResponseUnmarshaller _instance = new CreateAccountResponseUnmarshaller(); internal static CreateAccountResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateAccountResponseUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// CreateAppInstanceAdmin Request Marshaller /// </summary> public class CreateAppInstanceAdminRequestMarshaller : IMarshaller<IRequest, CreateAppInstanceAdminRequest> , 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((CreateAppInstanceAdminRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateAppInstanceAdminRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; if (!publicRequest.IsSetAppInstanceArn()) throw new AmazonChimeException("Request object does not have required field AppInstanceArn set"); request.AddPathResource("{appInstanceArn}", StringUtils.FromString(publicRequest.AppInstanceArn)); request.ResourcePath = "/app-instances/{appInstanceArn}/admins"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetAppInstanceAdminArn()) { context.Writer.WritePropertyName("AppInstanceAdminArn"); context.Writer.Write(publicRequest.AppInstanceAdminArn); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } request.HostPrefix = $"identity-"; return request; } private static CreateAppInstanceAdminRequestMarshaller _instance = new CreateAppInstanceAdminRequestMarshaller(); internal static CreateAppInstanceAdminRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateAppInstanceAdminRequestMarshaller Instance { get { return _instance; } } } }
106
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateAppInstanceAdmin operation /// </summary> public class CreateAppInstanceAdminResponseUnmarshaller : 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) { CreateAppInstanceAdminResponse response = new CreateAppInstanceAdminResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("AppInstanceAdmin", targetDepth)) { var unmarshaller = IdentityUnmarshaller.Instance; response.AppInstanceAdmin = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("AppInstanceArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.AppInstanceArn = 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("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceLimitExceededException")) { return ResourceLimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateAppInstanceAdminResponseUnmarshaller _instance = new CreateAppInstanceAdminResponseUnmarshaller(); internal static CreateAppInstanceAdminResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateAppInstanceAdminResponseUnmarshaller Instance { get { return _instance; } } } }
144
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// CreateAppInstance Request Marshaller /// </summary> public class CreateAppInstanceRequestMarshaller : IMarshaller<IRequest, CreateAppInstanceRequest> , 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((CreateAppInstanceRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateAppInstanceRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; request.ResourcePath = "/app-instances"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetClientRequestToken()) { context.Writer.WritePropertyName("ClientRequestToken"); context.Writer.Write(publicRequest.ClientRequestToken); } else if(!(publicRequest.IsSetClientRequestToken())) { context.Writer.WritePropertyName("ClientRequestToken"); context.Writer.Write(Guid.NewGuid().ToString()); } if(publicRequest.IsSetMetadata()) { context.Writer.WritePropertyName("Metadata"); context.Writer.Write(publicRequest.Metadata); } if(publicRequest.IsSetName()) { context.Writer.WritePropertyName("Name"); context.Writer.Write(publicRequest.Name); } if(publicRequest.IsSetTags()) { context.Writer.WritePropertyName("Tags"); context.Writer.WriteArrayStart(); foreach(var publicRequestTagsListValue in publicRequest.Tags) { context.Writer.WriteObjectStart(); var marshaller = TagMarshaller.Instance; marshaller.Marshall(publicRequestTagsListValue, context); context.Writer.WriteObjectEnd(); } context.Writer.WriteArrayEnd(); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } request.HostPrefix = $"identity-"; return request; } private static CreateAppInstanceRequestMarshaller _instance = new CreateAppInstanceRequestMarshaller(); internal static CreateAppInstanceRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateAppInstanceRequestMarshaller Instance { get { return _instance; } } } }
136
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateAppInstance operation /// </summary> public class CreateAppInstanceResponseUnmarshaller : 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) { CreateAppInstanceResponse response = new CreateAppInstanceResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("AppInstanceArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.AppInstanceArn = 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("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceLimitExceededException")) { return ResourceLimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateAppInstanceResponseUnmarshaller _instance = new CreateAppInstanceResponseUnmarshaller(); internal static CreateAppInstanceResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateAppInstanceResponseUnmarshaller Instance { get { return _instance; } } } }
138
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// CreateAppInstanceUser Request Marshaller /// </summary> public class CreateAppInstanceUserRequestMarshaller : IMarshaller<IRequest, CreateAppInstanceUserRequest> , 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((CreateAppInstanceUserRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateAppInstanceUserRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; request.ResourcePath = "/app-instance-users"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetAppInstanceArn()) { context.Writer.WritePropertyName("AppInstanceArn"); context.Writer.Write(publicRequest.AppInstanceArn); } if(publicRequest.IsSetAppInstanceUserId()) { context.Writer.WritePropertyName("AppInstanceUserId"); context.Writer.Write(publicRequest.AppInstanceUserId); } if(publicRequest.IsSetClientRequestToken()) { context.Writer.WritePropertyName("ClientRequestToken"); context.Writer.Write(publicRequest.ClientRequestToken); } else if(!(publicRequest.IsSetClientRequestToken())) { context.Writer.WritePropertyName("ClientRequestToken"); context.Writer.Write(Guid.NewGuid().ToString()); } if(publicRequest.IsSetMetadata()) { context.Writer.WritePropertyName("Metadata"); context.Writer.Write(publicRequest.Metadata); } if(publicRequest.IsSetName()) { context.Writer.WritePropertyName("Name"); context.Writer.Write(publicRequest.Name); } if(publicRequest.IsSetTags()) { context.Writer.WritePropertyName("Tags"); context.Writer.WriteArrayStart(); foreach(var publicRequestTagsListValue in publicRequest.Tags) { context.Writer.WriteObjectStart(); var marshaller = TagMarshaller.Instance; marshaller.Marshall(publicRequestTagsListValue, context); context.Writer.WriteObjectEnd(); } context.Writer.WriteArrayEnd(); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } request.HostPrefix = $"identity-"; return request; } private static CreateAppInstanceUserRequestMarshaller _instance = new CreateAppInstanceUserRequestMarshaller(); internal static CreateAppInstanceUserRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateAppInstanceUserRequestMarshaller Instance { get { return _instance; } } } }
148
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateAppInstanceUser operation /// </summary> public class CreateAppInstanceUserResponseUnmarshaller : 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) { CreateAppInstanceUserResponse response = new CreateAppInstanceUserResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("AppInstanceUserArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.AppInstanceUserArn = 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("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceLimitExceededException")) { return ResourceLimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateAppInstanceUserResponseUnmarshaller _instance = new CreateAppInstanceUserResponseUnmarshaller(); internal static CreateAppInstanceUserResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateAppInstanceUserResponseUnmarshaller Instance { get { return _instance; } } } }
138
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateAttendeeError Object /// </summary> public class CreateAttendeeErrorUnmarshaller : IUnmarshaller<CreateAttendeeError, XmlUnmarshallerContext>, IUnmarshaller<CreateAttendeeError, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> CreateAttendeeError IUnmarshaller<CreateAttendeeError, 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 CreateAttendeeError Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; CreateAttendeeError unmarshalledObject = new CreateAttendeeError(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ErrorCode", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ErrorCode = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ErrorMessage", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ErrorMessage = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ExternalUserId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ExternalUserId = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static CreateAttendeeErrorUnmarshaller _instance = new CreateAttendeeErrorUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static CreateAttendeeErrorUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// CreateAttendeeRequestItem Marshaller /// </summary> public class CreateAttendeeRequestItemMarshaller : IRequestMarshaller<CreateAttendeeRequestItem, 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(CreateAttendeeRequestItem requestObject, JsonMarshallerContext context) { if(requestObject.IsSetExternalUserId()) { context.Writer.WritePropertyName("ExternalUserId"); context.Writer.Write(requestObject.ExternalUserId); } if(requestObject.IsSetTags()) { context.Writer.WritePropertyName("Tags"); context.Writer.WriteArrayStart(); foreach(var requestObjectTagsListValue in requestObject.Tags) { context.Writer.WriteObjectStart(); var marshaller = TagMarshaller.Instance; marshaller.Marshall(requestObjectTagsListValue, context); context.Writer.WriteObjectEnd(); } context.Writer.WriteArrayEnd(); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static CreateAttendeeRequestItemMarshaller Instance = new CreateAttendeeRequestItemMarshaller(); } }
78
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// CreateAttendee Request Marshaller /// </summary> public class CreateAttendeeRequestMarshaller : IMarshaller<IRequest, CreateAttendeeRequest> , 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((CreateAttendeeRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateAttendeeRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; if (!publicRequest.IsSetMeetingId()) throw new AmazonChimeException("Request object does not have required field MeetingId set"); request.AddPathResource("{meetingId}", StringUtils.FromString(publicRequest.MeetingId)); request.ResourcePath = "/meetings/{meetingId}/attendees"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetExternalUserId()) { context.Writer.WritePropertyName("ExternalUserId"); context.Writer.Write(publicRequest.ExternalUserId); } if(publicRequest.IsSetTags()) { context.Writer.WritePropertyName("Tags"); context.Writer.WriteArrayStart(); foreach(var publicRequestTagsListValue in publicRequest.Tags) { context.Writer.WriteObjectStart(); var marshaller = TagMarshaller.Instance; marshaller.Marshall(publicRequestTagsListValue, 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 CreateAttendeeRequestMarshaller _instance = new CreateAttendeeRequestMarshaller(); internal static CreateAttendeeRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateAttendeeRequestMarshaller Instance { get { return _instance; } } } }
120
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateAttendee operation /// </summary> public class CreateAttendeeResponseUnmarshaller : 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) { CreateAttendeeResponse response = new CreateAttendeeResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Attendee", targetDepth)) { var unmarshaller = AttendeeUnmarshaller.Instance; response.Attendee = 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("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.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("ResourceLimitExceededException")) { return ResourceLimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateAttendeeResponseUnmarshaller _instance = new CreateAttendeeResponseUnmarshaller(); internal static CreateAttendeeResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateAttendeeResponseUnmarshaller Instance { get { return _instance; } } } }
138
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// CreateBot Request Marshaller /// </summary> public class CreateBotRequestMarshaller : IMarshaller<IRequest, CreateBotRequest> , 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((CreateBotRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateBotRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; if (!publicRequest.IsSetAccountId()) throw new AmazonChimeException("Request object does not have required field AccountId set"); request.AddPathResource("{accountId}", StringUtils.FromString(publicRequest.AccountId)); request.ResourcePath = "/accounts/{accountId}/bots"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetDisplayName()) { context.Writer.WritePropertyName("DisplayName"); context.Writer.Write(publicRequest.DisplayName); } if(publicRequest.IsSetDomain()) { context.Writer.WritePropertyName("Domain"); context.Writer.Write(publicRequest.Domain); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static CreateBotRequestMarshaller _instance = new CreateBotRequestMarshaller(); internal static CreateBotRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateBotRequestMarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateBot operation /// </summary> public class CreateBotResponseUnmarshaller : 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) { CreateBotResponse response = new CreateBotResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Bot", targetDepth)) { var unmarshaller = BotUnmarshaller.Instance; response.Bot = 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("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.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("ResourceLimitExceededException")) { return ResourceLimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateBotResponseUnmarshaller _instance = new CreateBotResponseUnmarshaller(); internal static CreateBotResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateBotResponseUnmarshaller Instance { get { return _instance; } } } }
138
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// CreateChannelBan Request Marshaller /// </summary> public class CreateChannelBanRequestMarshaller : IMarshaller<IRequest, CreateChannelBanRequest> , 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((CreateChannelBanRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateChannelBanRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; if (!publicRequest.IsSetChannelArn()) throw new AmazonChimeException("Request object does not have required field ChannelArn set"); request.AddPathResource("{channelArn}", StringUtils.FromString(publicRequest.ChannelArn)); request.ResourcePath = "/channels/{channelArn}/bans"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetMemberArn()) { context.Writer.WritePropertyName("MemberArn"); context.Writer.Write(publicRequest.MemberArn); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } if (publicRequest.IsSetChimeBearer()) { request.Headers["x-amz-chime-bearer"] = publicRequest.ChimeBearer; } request.HostPrefix = $"messaging-"; return request; } private static CreateChannelBanRequestMarshaller _instance = new CreateChannelBanRequestMarshaller(); internal static CreateChannelBanRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateChannelBanRequestMarshaller Instance { get { return _instance; } } } }
111
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateChannelBan operation /// </summary> public class CreateChannelBanResponseUnmarshaller : 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) { CreateChannelBanResponse response = new CreateChannelBanResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ChannelArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ChannelArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Member", targetDepth)) { var unmarshaller = IdentityUnmarshaller.Instance; response.Member = 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("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceLimitExceededException")) { return ResourceLimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateChannelBanResponseUnmarshaller _instance = new CreateChannelBanResponseUnmarshaller(); internal static CreateChannelBanResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateChannelBanResponseUnmarshaller Instance { get { return _instance; } } } }
144
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// CreateChannelMembership Request Marshaller /// </summary> public class CreateChannelMembershipRequestMarshaller : IMarshaller<IRequest, CreateChannelMembershipRequest> , 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((CreateChannelMembershipRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateChannelMembershipRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; if (!publicRequest.IsSetChannelArn()) throw new AmazonChimeException("Request object does not have required field ChannelArn set"); request.AddPathResource("{channelArn}", StringUtils.FromString(publicRequest.ChannelArn)); request.ResourcePath = "/channels/{channelArn}/memberships"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetMemberArn()) { context.Writer.WritePropertyName("MemberArn"); context.Writer.Write(publicRequest.MemberArn); } if(publicRequest.IsSetType()) { context.Writer.WritePropertyName("Type"); context.Writer.Write(publicRequest.Type); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } if (publicRequest.IsSetChimeBearer()) { request.Headers["x-amz-chime-bearer"] = publicRequest.ChimeBearer; } request.HostPrefix = $"messaging-"; return request; } private static CreateChannelMembershipRequestMarshaller _instance = new CreateChannelMembershipRequestMarshaller(); internal static CreateChannelMembershipRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateChannelMembershipRequestMarshaller Instance { get { return _instance; } } } }
117
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateChannelMembership operation /// </summary> public class CreateChannelMembershipResponseUnmarshaller : 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) { CreateChannelMembershipResponse response = new CreateChannelMembershipResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ChannelArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ChannelArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Member", targetDepth)) { var unmarshaller = IdentityUnmarshaller.Instance; response.Member = 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("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceLimitExceededException")) { return ResourceLimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateChannelMembershipResponseUnmarshaller _instance = new CreateChannelMembershipResponseUnmarshaller(); internal static CreateChannelMembershipResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateChannelMembershipResponseUnmarshaller Instance { get { return _instance; } } } }
144
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// CreateChannelModerator Request Marshaller /// </summary> public class CreateChannelModeratorRequestMarshaller : IMarshaller<IRequest, CreateChannelModeratorRequest> , 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((CreateChannelModeratorRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateChannelModeratorRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; if (!publicRequest.IsSetChannelArn()) throw new AmazonChimeException("Request object does not have required field ChannelArn set"); request.AddPathResource("{channelArn}", StringUtils.FromString(publicRequest.ChannelArn)); request.ResourcePath = "/channels/{channelArn}/moderators"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetChannelModeratorArn()) { context.Writer.WritePropertyName("ChannelModeratorArn"); context.Writer.Write(publicRequest.ChannelModeratorArn); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } if (publicRequest.IsSetChimeBearer()) { request.Headers["x-amz-chime-bearer"] = publicRequest.ChimeBearer; } request.HostPrefix = $"messaging-"; return request; } private static CreateChannelModeratorRequestMarshaller _instance = new CreateChannelModeratorRequestMarshaller(); internal static CreateChannelModeratorRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateChannelModeratorRequestMarshaller Instance { get { return _instance; } } } }
111
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateChannelModerator operation /// </summary> public class CreateChannelModeratorResponseUnmarshaller : 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) { CreateChannelModeratorResponse response = new CreateChannelModeratorResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ChannelArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ChannelArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ChannelModerator", targetDepth)) { var unmarshaller = IdentityUnmarshaller.Instance; response.ChannelModerator = 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("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceLimitExceededException")) { return ResourceLimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateChannelModeratorResponseUnmarshaller _instance = new CreateChannelModeratorResponseUnmarshaller(); internal static CreateChannelModeratorResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateChannelModeratorResponseUnmarshaller Instance { get { return _instance; } } } }
144
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// CreateChannel Request Marshaller /// </summary> public class CreateChannelRequestMarshaller : IMarshaller<IRequest, CreateChannelRequest> , 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((CreateChannelRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateChannelRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; request.ResourcePath = "/channels"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetAppInstanceArn()) { context.Writer.WritePropertyName("AppInstanceArn"); context.Writer.Write(publicRequest.AppInstanceArn); } if(publicRequest.IsSetClientRequestToken()) { context.Writer.WritePropertyName("ClientRequestToken"); context.Writer.Write(publicRequest.ClientRequestToken); } else if(!(publicRequest.IsSetClientRequestToken())) { context.Writer.WritePropertyName("ClientRequestToken"); context.Writer.Write(Guid.NewGuid().ToString()); } if(publicRequest.IsSetMetadata()) { context.Writer.WritePropertyName("Metadata"); context.Writer.Write(publicRequest.Metadata); } if(publicRequest.IsSetMode()) { context.Writer.WritePropertyName("Mode"); context.Writer.Write(publicRequest.Mode); } if(publicRequest.IsSetName()) { context.Writer.WritePropertyName("Name"); context.Writer.Write(publicRequest.Name); } if(publicRequest.IsSetPrivacy()) { context.Writer.WritePropertyName("Privacy"); context.Writer.Write(publicRequest.Privacy); } if(publicRequest.IsSetTags()) { context.Writer.WritePropertyName("Tags"); context.Writer.WriteArrayStart(); foreach(var publicRequestTagsListValue in publicRequest.Tags) { context.Writer.WriteObjectStart(); var marshaller = TagMarshaller.Instance; marshaller.Marshall(publicRequestTagsListValue, context); context.Writer.WriteObjectEnd(); } context.Writer.WriteArrayEnd(); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } if (publicRequest.IsSetChimeBearer()) { request.Headers["x-amz-chime-bearer"] = publicRequest.ChimeBearer; } request.HostPrefix = $"messaging-"; return request; } private static CreateChannelRequestMarshaller _instance = new CreateChannelRequestMarshaller(); internal static CreateChannelRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateChannelRequestMarshaller Instance { get { return _instance; } } } }
159
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateChannel operation /// </summary> public class CreateChannelResponseUnmarshaller : 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) { CreateChannelResponse response = new CreateChannelResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ChannelArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ChannelArn = 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("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceLimitExceededException")) { return ResourceLimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateChannelResponseUnmarshaller _instance = new CreateChannelResponseUnmarshaller(); internal static CreateChannelResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateChannelResponseUnmarshaller Instance { get { return _instance; } } } }
138
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// CreateMediaCapturePipeline Request Marshaller /// </summary> public class CreateMediaCapturePipelineRequestMarshaller : IMarshaller<IRequest, CreateMediaCapturePipelineRequest> , 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((CreateMediaCapturePipelineRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateMediaCapturePipelineRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; request.ResourcePath = "/media-capture-pipelines"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetChimeSdkMeetingConfiguration()) { context.Writer.WritePropertyName("ChimeSdkMeetingConfiguration"); context.Writer.WriteObjectStart(); var marshaller = ChimeSdkMeetingConfigurationMarshaller.Instance; marshaller.Marshall(publicRequest.ChimeSdkMeetingConfiguration, context); context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetClientRequestToken()) { context.Writer.WritePropertyName("ClientRequestToken"); context.Writer.Write(publicRequest.ClientRequestToken); } else if(!(publicRequest.IsSetClientRequestToken())) { context.Writer.WritePropertyName("ClientRequestToken"); context.Writer.Write(Guid.NewGuid().ToString()); } if(publicRequest.IsSetSinkArn()) { context.Writer.WritePropertyName("SinkArn"); context.Writer.Write(publicRequest.SinkArn); } if(publicRequest.IsSetSinkType()) { context.Writer.WritePropertyName("SinkType"); context.Writer.Write(publicRequest.SinkType); } if(publicRequest.IsSetSourceArn()) { context.Writer.WritePropertyName("SourceArn"); context.Writer.Write(publicRequest.SourceArn); } if(publicRequest.IsSetSourceType()) { context.Writer.WritePropertyName("SourceType"); context.Writer.Write(publicRequest.SourceType); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static CreateMediaCapturePipelineRequestMarshaller _instance = new CreateMediaCapturePipelineRequestMarshaller(); internal static CreateMediaCapturePipelineRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateMediaCapturePipelineRequestMarshaller Instance { get { return _instance; } } } }
141
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateMediaCapturePipeline operation /// </summary> public class CreateMediaCapturePipelineResponseUnmarshaller : 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) { CreateMediaCapturePipelineResponse response = new CreateMediaCapturePipelineResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("MediaCapturePipeline", targetDepth)) { var unmarshaller = MediaCapturePipelineUnmarshaller.Instance; response.MediaCapturePipeline = 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("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceLimitExceededException")) { return ResourceLimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateMediaCapturePipelineResponseUnmarshaller _instance = new CreateMediaCapturePipelineResponseUnmarshaller(); internal static CreateMediaCapturePipelineResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateMediaCapturePipelineResponseUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// CreateMeetingDialOut Request Marshaller /// </summary> public class CreateMeetingDialOutRequestMarshaller : IMarshaller<IRequest, CreateMeetingDialOutRequest> , 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((CreateMeetingDialOutRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateMeetingDialOutRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; if (!publicRequest.IsSetMeetingId()) throw new AmazonChimeException("Request object does not have required field MeetingId set"); request.AddPathResource("{meetingId}", StringUtils.FromString(publicRequest.MeetingId)); request.ResourcePath = "/meetings/{meetingId}/dial-outs"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetFromPhoneNumber()) { context.Writer.WritePropertyName("FromPhoneNumber"); context.Writer.Write(publicRequest.FromPhoneNumber); } if(publicRequest.IsSetJoinToken()) { context.Writer.WritePropertyName("JoinToken"); context.Writer.Write(publicRequest.JoinToken); } if(publicRequest.IsSetToPhoneNumber()) { context.Writer.WritePropertyName("ToPhoneNumber"); context.Writer.Write(publicRequest.ToPhoneNumber); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static CreateMeetingDialOutRequestMarshaller _instance = new CreateMeetingDialOutRequestMarshaller(); internal static CreateMeetingDialOutRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateMeetingDialOutRequestMarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateMeetingDialOut operation /// </summary> public class CreateMeetingDialOutResponseUnmarshaller : 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) { CreateMeetingDialOutResponse response = new CreateMeetingDialOutResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("TransactionId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.TransactionId = 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("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceLimitExceededException")) { return ResourceLimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateMeetingDialOutResponseUnmarshaller _instance = new CreateMeetingDialOutResponseUnmarshaller(); internal static CreateMeetingDialOutResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateMeetingDialOutResponseUnmarshaller Instance { get { return _instance; } } } }
138
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// CreateMeeting Request Marshaller /// </summary> public class CreateMeetingRequestMarshaller : IMarshaller<IRequest, CreateMeetingRequest> , 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((CreateMeetingRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateMeetingRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; request.ResourcePath = "/meetings"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetClientRequestToken()) { context.Writer.WritePropertyName("ClientRequestToken"); context.Writer.Write(publicRequest.ClientRequestToken); } else if(!(publicRequest.IsSetClientRequestToken())) { context.Writer.WritePropertyName("ClientRequestToken"); context.Writer.Write(Guid.NewGuid().ToString()); } if(publicRequest.IsSetExternalMeetingId()) { context.Writer.WritePropertyName("ExternalMeetingId"); context.Writer.Write(publicRequest.ExternalMeetingId); } if(publicRequest.IsSetMediaRegion()) { context.Writer.WritePropertyName("MediaRegion"); context.Writer.Write(publicRequest.MediaRegion); } if(publicRequest.IsSetMeetingHostId()) { context.Writer.WritePropertyName("MeetingHostId"); context.Writer.Write(publicRequest.MeetingHostId); } if(publicRequest.IsSetNotificationsConfiguration()) { context.Writer.WritePropertyName("NotificationsConfiguration"); context.Writer.WriteObjectStart(); var marshaller = MeetingNotificationConfigurationMarshaller.Instance; marshaller.Marshall(publicRequest.NotificationsConfiguration, context); context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetTags()) { context.Writer.WritePropertyName("Tags"); context.Writer.WriteArrayStart(); foreach(var publicRequestTagsListValue in publicRequest.Tags) { context.Writer.WriteObjectStart(); var marshaller = TagMarshaller.Instance; marshaller.Marshall(publicRequestTagsListValue, 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 CreateMeetingRequestMarshaller _instance = new CreateMeetingRequestMarshaller(); internal static CreateMeetingRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateMeetingRequestMarshaller Instance { get { return _instance; } } } }
151
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateMeeting operation /// </summary> public class CreateMeetingResponseUnmarshaller : 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) { CreateMeetingResponse response = new CreateMeetingResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Meeting", targetDepth)) { var unmarshaller = MeetingUnmarshaller.Instance; response.Meeting = 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("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceLimitExceededException")) { return ResourceLimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateMeetingResponseUnmarshaller _instance = new CreateMeetingResponseUnmarshaller(); internal static CreateMeetingResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateMeetingResponseUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// CreateMeetingWithAttendees Request Marshaller /// </summary> public class CreateMeetingWithAttendeesRequestMarshaller : IMarshaller<IRequest, CreateMeetingWithAttendeesRequest> , 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((CreateMeetingWithAttendeesRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateMeetingWithAttendeesRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; request.AddSubResource("operation", "create-attendees"); request.ResourcePath = "/meetings"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetAttendees()) { context.Writer.WritePropertyName("Attendees"); context.Writer.WriteArrayStart(); foreach(var publicRequestAttendeesListValue in publicRequest.Attendees) { context.Writer.WriteObjectStart(); var marshaller = CreateAttendeeRequestItemMarshaller.Instance; marshaller.Marshall(publicRequestAttendeesListValue, context); context.Writer.WriteObjectEnd(); } context.Writer.WriteArrayEnd(); } if(publicRequest.IsSetClientRequestToken()) { context.Writer.WritePropertyName("ClientRequestToken"); context.Writer.Write(publicRequest.ClientRequestToken); } else if(!(publicRequest.IsSetClientRequestToken())) { context.Writer.WritePropertyName("ClientRequestToken"); context.Writer.Write(Guid.NewGuid().ToString()); } if(publicRequest.IsSetExternalMeetingId()) { context.Writer.WritePropertyName("ExternalMeetingId"); context.Writer.Write(publicRequest.ExternalMeetingId); } if(publicRequest.IsSetMediaRegion()) { context.Writer.WritePropertyName("MediaRegion"); context.Writer.Write(publicRequest.MediaRegion); } if(publicRequest.IsSetMeetingHostId()) { context.Writer.WritePropertyName("MeetingHostId"); context.Writer.Write(publicRequest.MeetingHostId); } if(publicRequest.IsSetNotificationsConfiguration()) { context.Writer.WritePropertyName("NotificationsConfiguration"); context.Writer.WriteObjectStart(); var marshaller = MeetingNotificationConfigurationMarshaller.Instance; marshaller.Marshall(publicRequest.NotificationsConfiguration, context); context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetTags()) { context.Writer.WritePropertyName("Tags"); context.Writer.WriteArrayStart(); foreach(var publicRequestTagsListValue in publicRequest.Tags) { context.Writer.WriteObjectStart(); var marshaller = TagMarshaller.Instance; marshaller.Marshall(publicRequestTagsListValue, 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 CreateMeetingWithAttendeesRequestMarshaller _instance = new CreateMeetingWithAttendeesRequestMarshaller(); internal static CreateMeetingWithAttendeesRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateMeetingWithAttendeesRequestMarshaller Instance { get { return _instance; } } } }
168
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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateMeetingWithAttendees operation /// </summary> public class CreateMeetingWithAttendeesResponseUnmarshaller : 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) { CreateMeetingWithAttendeesResponse response = new CreateMeetingWithAttendeesResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Attendees", targetDepth)) { var unmarshaller = new ListUnmarshaller<Attendee, AttendeeUnmarshaller>(AttendeeUnmarshaller.Instance); response.Attendees = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Errors", targetDepth)) { var unmarshaller = new ListUnmarshaller<CreateAttendeeError, CreateAttendeeErrorUnmarshaller>(CreateAttendeeErrorUnmarshaller.Instance); response.Errors = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Meeting", targetDepth)) { var unmarshaller = MeetingUnmarshaller.Instance; response.Meeting = 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("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceLimitExceededException")) { return ResourceLimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateMeetingWithAttendeesResponseUnmarshaller _instance = new CreateMeetingWithAttendeesResponseUnmarshaller(); internal static CreateMeetingWithAttendeesResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateMeetingWithAttendeesResponseUnmarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// CreatePhoneNumberOrder Request Marshaller /// </summary> public class CreatePhoneNumberOrderRequestMarshaller : IMarshaller<IRequest, CreatePhoneNumberOrderRequest> , 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((CreatePhoneNumberOrderRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreatePhoneNumberOrderRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Chime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-05-01"; request.HttpMethod = "POST"; request.ResourcePath = "/phone-number-orders"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetE164PhoneNumbers()) { context.Writer.WritePropertyName("E164PhoneNumbers"); context.Writer.WriteArrayStart(); foreach(var publicRequestE164PhoneNumbersListValue in publicRequest.E164PhoneNumbers) { context.Writer.Write(publicRequestE164PhoneNumbersListValue); } context.Writer.WriteArrayEnd(); } if(publicRequest.IsSetProductType()) { context.Writer.WritePropertyName("ProductType"); context.Writer.Write(publicRequest.ProductType); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static CreatePhoneNumberOrderRequestMarshaller _instance = new CreatePhoneNumberOrderRequestMarshaller(); internal static CreatePhoneNumberOrderRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreatePhoneNumberOrderRequestMarshaller 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 chime-2018-05-01.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.Chime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Chime.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreatePhoneNumberOrder operation /// </summary> public class CreatePhoneNumberOrderResponseUnmarshaller : 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) { CreatePhoneNumberOrderResponse response = new CreatePhoneNumberOrderResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("PhoneNumberOrder", targetDepth)) { var unmarshaller = PhoneNumberOrderUnmarshaller.Instance; response.PhoneNumberOrder = 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("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceLimitExceededException")) { return ResourceLimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceFailureException")) { return ServiceFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottledClientException")) { return ThrottledClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnauthorizedClientException")) { return UnauthorizedClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonChimeException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreatePhoneNumberOrderResponseUnmarshaller _instance = new CreatePhoneNumberOrderResponseUnmarshaller(); internal static CreatePhoneNumberOrderResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreatePhoneNumberOrderResponseUnmarshaller Instance { get { return _instance; } } } }
138