ServiceClientGenerator.CustomizationsModel.OverrideDataType C# (CSharp) Method

OverrideDataType() public method

Gets any customizations for a new data type to be used on a property
public OverrideDataType ( string shapeName, string propertyName ) : DataTypeOverride
shapeName string The name of the shape the property is defined within
propertyName string The name of the property to check
return DataTypeOverride
        public DataTypeOverride OverrideDataType(string shapeName, string propertyName)
        {
            var data = _documentRoot[DataTypeSwapKey];
            if (data == null)
                return null;

            var shape = data[shapeName] as JsonData;
            if (shape == null)
                return null;

            var jsonData = shape[propertyName];
            if (jsonData == null)
                return null;

            var dataType = (string)jsonData[TypeKey];
            string marshaller = null;
            if (jsonData[MarshallerKey] != null && jsonData[MarshallerKey].IsString)
                marshaller = (string)jsonData[MarshallerKey];

            string unmarshaller = null;
            if (jsonData[UnmarshallerKey] != null && jsonData[UnmarshallerKey].IsString)
                unmarshaller = (string)jsonData[UnmarshallerKey];

            return new DataTypeOverride(dataType, marshaller, unmarshaller);
        }