private void putValue(object value) { if (value == null) { return; } if (value is IMwsObject) { parameterPrefix.Append('.'); (value as IMwsObject).WriteFragmentTo(this); return; } string name = parameterPrefix.ToString(); if (value is DateTime) { parameters.Add(name, MwsUtil.GetFormattedTimestamp((DateTime)value)); return; } string valueStr = value.ToString(); if (valueStr == null || valueStr.Length == 0) { return; } if (value is bool) { valueStr = valueStr.ToLower(); } parameters.Add(name, valueStr); }
/// <summary> /// Add authentication related and version parameters /// </summary> /// <param name="parameters"></param> private void AddRequiredParameters() { parameters.Add("AWSAccessKeyId", connection.AwsAccessKeyId); parameters.Add("Action", operationName); parameters.Add("Timestamp", MwsUtil.GetFormattedTimestamp()); parameters.Add("Version", serviceEndPoint.version); string signature = MwsUtil.SignParameters(serviceEndPoint.URI, connection.SignatureVersion, connection.SignatureMethod, parameters, connection.AwsSecretKeyId); parameters.Add("Signature", signature); }