public IRequest Marshall(ListObjectsRequest listObjectsRequest) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown IRequest val = new DefaultRequest(listObjectsRequest, "AmazonS3"); val.set_HttpMethod("GET"); if (listObjectsRequest.IsSetRequestPayer()) { val.get_Headers().Add(S3Constants.AmzHeaderRequestPayer, S3Transforms.ToStringValue(((object)listObjectsRequest.RequestPayer).ToString())); } val.set_ResourcePath("/" + S3Transforms.ToStringValue(listObjectsRequest.BucketName)); if (listObjectsRequest.IsSetDelimiter()) { val.get_Parameters().Add("delimiter", S3Transforms.ToStringValue(listObjectsRequest.Delimiter)); } if (listObjectsRequest.IsSetMarker()) { val.get_Parameters().Add("marker", S3Transforms.ToStringValue(listObjectsRequest.Marker)); } if (listObjectsRequest.IsSetMaxKeys()) { val.get_Parameters().Add("max-keys", S3Transforms.ToStringValue(listObjectsRequest.MaxKeys)); } if (listObjectsRequest.IsSetPrefix()) { val.get_Parameters().Add("prefix", S3Transforms.ToStringValue(listObjectsRequest.Prefix)); } if (listObjectsRequest.IsSetEncoding()) { val.get_Parameters().Add("encoding-type", S3Transforms.ToStringValue(ConstantClass.op_Implicit(listObjectsRequest.Encoding))); } val.set_UseQueryString(true); return(val); }
public IRequest Marshall(InitiateMultipartUploadRequest initiateMultipartUploadRequest) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown IRequest val = new DefaultRequest(initiateMultipartUploadRequest, "AmazonS3"); val.set_HttpMethod("POST"); if (initiateMultipartUploadRequest.IsSetCannedACL()) { val.get_Headers().Add("x-amz-acl", S3Transforms.ToStringValue(ConstantClass.op_Implicit(initiateMultipartUploadRequest.CannedACL))); } HeadersCollection headers = initiateMultipartUploadRequest.Headers; foreach (string key in headers.Keys) { val.get_Headers().Add(key, headers[key]); } HeaderACLRequestMarshaller.Marshall(val, initiateMultipartUploadRequest); if (initiateMultipartUploadRequest.IsSetServerSideEncryptionMethod()) { val.get_Headers().Add("x-amz-server-side-encryption", S3Transforms.ToStringValue(ConstantClass.op_Implicit(initiateMultipartUploadRequest.ServerSideEncryptionMethod))); } if (initiateMultipartUploadRequest.IsSetServerSideEncryptionCustomerMethod()) { val.get_Headers().Add("x-amz-server-side-encryption-customer-algorithm", ConstantClass.op_Implicit(initiateMultipartUploadRequest.ServerSideEncryptionCustomerMethod)); } if (initiateMultipartUploadRequest.IsSetServerSideEncryptionCustomerProvidedKey()) { val.get_Headers().Add("x-amz-server-side-encryption-customer-key", initiateMultipartUploadRequest.ServerSideEncryptionCustomerProvidedKey); if (initiateMultipartUploadRequest.IsSetServerSideEncryptionCustomerProvidedKeyMD5()) { val.get_Headers().Add("x-amz-server-side-encryption-customer-key-MD5", initiateMultipartUploadRequest.ServerSideEncryptionCustomerProvidedKeyMD5); } else { val.get_Headers().Add("x-amz-server-side-encryption-customer-key-MD5", AmazonS3Util.ComputeEncodedMD5FromEncodedString(initiateMultipartUploadRequest.ServerSideEncryptionCustomerProvidedKey)); } } if (initiateMultipartUploadRequest.IsSetServerSideEncryptionKeyManagementServiceKeyId()) { val.get_Headers().Add("x-amz-server-side-encryption-aws-kms-key-id", initiateMultipartUploadRequest.ServerSideEncryptionKeyManagementServiceKeyId); } if (initiateMultipartUploadRequest.IsSetStorageClass()) { val.get_Headers().Add("x-amz-storage-class", S3Transforms.ToStringValue(ConstantClass.op_Implicit(initiateMultipartUploadRequest.StorageClass))); } if (initiateMultipartUploadRequest.IsSetWebsiteRedirectLocation()) { val.get_Headers().Add("x-amz-website-redirect-location", S3Transforms.ToStringValue(initiateMultipartUploadRequest.WebsiteRedirectLocation)); } if (initiateMultipartUploadRequest.IsSetRequestPayer()) { val.get_Headers().Add(S3Constants.AmzHeaderRequestPayer, S3Transforms.ToStringValue(((object)initiateMultipartUploadRequest.RequestPayer).ToString())); } AmazonS3Util.SetMetadataHeaders(val, initiateMultipartUploadRequest.Metadata); val.set_ResourcePath(string.Format(CultureInfo.InvariantCulture, "/{0}/{1}", S3Transforms.ToStringValue(initiateMultipartUploadRequest.BucketName), S3Transforms.ToStringValue(initiateMultipartUploadRequest.Key))); val.AddSubResource("uploads"); val.set_UseQueryString(true); return(val); }
public IRequest Marshall(ListPartsRequest listPartsRequest) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown IRequest val = new DefaultRequest(listPartsRequest, "AmazonS3"); if (listPartsRequest.IsSetRequestPayer()) { val.get_Headers().Add(S3Constants.AmzHeaderRequestPayer, S3Transforms.ToStringValue(((object)listPartsRequest.RequestPayer).ToString())); } val.set_HttpMethod("GET"); val.set_ResourcePath(string.Format(CultureInfo.InvariantCulture, "/{0}/{1}", S3Transforms.ToStringValue(listPartsRequest.BucketName), S3Transforms.ToStringValue(listPartsRequest.Key))); if (listPartsRequest.IsSetUploadId()) { val.AddSubResource("uploadId", S3Transforms.ToStringValue(listPartsRequest.UploadId)); } if (listPartsRequest.IsSetMaxParts()) { val.get_Parameters().Add("max-parts", S3Transforms.ToStringValue(listPartsRequest.MaxParts)); } if (listPartsRequest.IsSetPartNumberMarker()) { val.get_Parameters().Add("part-number-marker", S3Transforms.ToStringValue(listPartsRequest.PartNumberMarker)); } if (listPartsRequest.IsSetEncoding()) { val.get_Parameters().Add("encoding-type", S3Transforms.ToStringValue(ConstantClass.op_Implicit(listPartsRequest.Encoding))); } val.set_UseQueryString(true); return(val); }
public static S3Region FindValue(string value) { if (value == null) { return(US); } return(ConstantClass.FindValue <S3Region>(value)); }
public static string FromString(ConstantClass value) { if (!(value == null)) { return(value.Intern().Value); } return(""); }
public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { if (info != null) { info.AddValue("deleted", deleted); info.AddValue("errors", errors); info.AddValue("requestCharged", ConstantClass.op_Implicit(requestCharged)); } }
public static ConstantPoolInfo Read(ClassReader classReader) { ushort tag = classReader.ReadU1(); ConstantPoolInfo constantPoolInfo = null; switch (tag) { case 7: constantPoolInfo = new ConstantClass(); break; case 9: constantPoolInfo = new ConstantFieldRef(); break; case 10: constantPoolInfo = new ConstantMethodRef(); break; case 11: constantPoolInfo = new ConstantInterfaceMethodRef(); break; case 8: constantPoolInfo = new ConstantString(); break; case 3: constantPoolInfo = new ConstantInteger(); break; case 4: constantPoolInfo = new ConstantFloat(); break; case 5: constantPoolInfo = new ConstantLong(); break; case 6: constantPoolInfo = new ConstantDouble(); break; case 12: constantPoolInfo = new ConstantNameAndType(); break; case 1: constantPoolInfo = new ConstantUtf8(); break; case 15: constantPoolInfo = new ConstantMethodHandle(); break; case 16: constantPoolInfo = new ConstantMethodType(); break; case 18: constantPoolInfo = new ConstantInvokeDynamic(); break; default: throw new Exception("ClassFileError:constantPoolInfo incorrect"); } constantPoolInfo.Tag = tag; constantPoolInfo.ReadConstantPoolInfo(classReader); return(constantPoolInfo); }
internal void WriteFormData(string boundary, Stream outputStream) { if (!string.IsNullOrEmpty(Key)) { WriteFormDatum(outputStream, S3Constants.PostFormDataObjectKey, Key, boundary); } WriteFormDatum(outputStream, S3Constants.PostFormDataAcl, ConstantClass.op_Implicit(CannedACL), boundary); if (_isSetStorageClass) { WriteFormDatum(outputStream, "x-amz-storage-class", ConstantClass.op_Implicit(StorageClass), boundary); } if (_isSetActionStatus) { WriteFormDatum(outputStream, S3Constants.PostFormDataStatus, ((int)SuccessActionStatus).ToString((IFormatProvider)CultureInfo.InvariantCulture), boundary); } if (!string.IsNullOrEmpty(SuccessActionRedirect)) { WriteFormDatum(outputStream, S3Constants.PostFormDataRedirect, SuccessActionRedirect, boundary); } if (SignedPolicy != null && !string.IsNullOrEmpty(SignedPolicy.SecurityToken)) { Metadata[S3Constants.PostFormDataSecurityToken] = SignedPolicy.SecurityToken; } foreach (string key in Headers.Keys) { if (!string.IsNullOrEmpty(Headers[key])) { WriteFormDatum(outputStream, key, Headers[key], boundary); } } foreach (KeyValuePair <string, string> metadatum in Metadata) { string name = metadatum.Key.StartsWith(S3Constants.PostFormDataXAmzPrefix, StringComparison.Ordinal) ? metadatum.Key : (S3Constants.PostFormDataMetaPrefix + metadatum.Key); WriteFormDatum(outputStream, name, metadatum.Value, boundary); } if (SignedPolicy != null) { if (SignedPolicy.SignatureVersion == "2") { WriteFormDatum(outputStream, S3Constants.PostFormDataPolicy, SignedPolicy.Policy, boundary); WriteFormDatum(outputStream, S3Constants.PostFormDataSignature, SignedPolicy.Signature, boundary); WriteFormDatum(outputStream, S3Constants.PostFormDataAccessKeyId, SignedPolicy.AccessKeyId, boundary); } else { WriteFormDatum(outputStream, S3Constants.PostFormDataPolicy, SignedPolicy.Policy, boundary); WriteFormDatum(outputStream, S3Constants.PostFormDataXAmzSignature, SignedPolicy.Signature, boundary); WriteFormDatum(outputStream, S3Constants.PostFormDataXAmzAlgorithm, SignedPolicy.Algorithm, boundary); WriteFormDatum(outputStream, S3Constants.PostFormDataXAmzCredential, SignedPolicy.Credential, boundary); WriteFormDatum(outputStream, S3Constants.PostFormDataXAmzDate, SignedPolicy.Date, boundary); } } }
public ObjectReference AddObject(ConstantClass classContstant, ConstantPool cp) { foreach (JavaClass currentClass in loadedClasses) { if (currentClass.ThisClassName == cp.GetConstantUtf8(classContstant.NameIndex).Value) { objects.Add(new ClassEntity(currentClass)); return(new ObjectReference(ObjectReference.type.ClassInstance, objects.Count - 1)); } } return(null); }
internal void WriteFormData(string boundary, Stream outputStream) { if (!string.IsNullOrEmpty(Key)) { WriteFormDatum(outputStream, S3Constants.PostFormDataObjectKey, Key, boundary); } WriteFormDatum(outputStream, S3Constants.PostFormDataAcl, ConstantClass.op_Implicit(CannedACL), boundary); if (_isSetStorageClass) { WriteFormDatum(outputStream, "x-amz-storage-class", ConstantClass.op_Implicit(StorageClass), boundary); } if (_isSetActionStatus) { WriteFormDatum(outputStream, S3Constants.PostFormDataStatus, ((int)SuccessActionStatus).ToString((IFormatProvider)CultureInfo.InvariantCulture), boundary); } if (!string.IsNullOrEmpty(SuccessActionRedirect)) { WriteFormDatum(outputStream, S3Constants.PostFormDataRedirect, SuccessActionRedirect, boundary); } if (string.IsNullOrEmpty(ContentType)) { if (Key.IndexOf('.') > -1) { ContentType = AmazonS3Util.MimeTypeFromExtension(Key.Substring(Key.LastIndexOf('.'))); } else if (!string.IsNullOrEmpty(Path) && Path.IndexOf('.') > -1) { ContentType = AmazonS3Util.MimeTypeFromExtension(Key.Substring(Path.LastIndexOf('.'))); } } WriteFormDatum(outputStream, S3Constants.PostFormDataContentType, ContentType, boundary); if (SignedPolicy != null && !string.IsNullOrEmpty(SignedPolicy.SecurityToken)) { Metadata[S3Constants.PostFormDataSecurityToken] = SignedPolicy.SecurityToken; } foreach (KeyValuePair <string, string> metadatum in Metadata) { string name = metadatum.Key.StartsWith(S3Constants.PostFormDataXAmzPrefix, StringComparison.Ordinal) ? metadatum.Key : (S3Constants.PostFormDataMetaPrefix + metadatum.Key); WriteFormDatum(outputStream, name, metadatum.Value, boundary); } if (SignedPolicy != null) { WriteFormDatum(outputStream, S3Constants.PostFormDataAccessKeyId, SignedPolicy.AccessKeyId, boundary); WriteFormDatum(outputStream, S3Constants.PostFormDataPolicy, SignedPolicy.Policy, boundary); WriteFormDatum(outputStream, S3Constants.PostFormDataSignature, SignedPolicy.Signature, boundary); } }
public AnalyticsS3BucketDestination Unmarshall(XmlUnmarshallerContext context) { AnalyticsS3BucketDestination analyticsS3BucketDestination = new AnalyticsS3BucketDestination(); int currentDepth = context.get_CurrentDepth(); int num = currentDepth + 1; if (context.get_IsStartOfDocument()) { num += 2; } while (context.Read()) { if (context.get_IsStartElement() || context.get_IsAttribute()) { if (context.TestExpression("Format", num)) { analyticsS3BucketDestination.Format = ConstantClass.op_Implicit(AnalyticsS3ExportFileFormat.FindValue(StringUnmarshaller.get_Instance().Unmarshall(context))); } else if (context.TestExpression("BucketAccountId", num)) { analyticsS3BucketDestination.BucketAccountId = StringUnmarshaller.get_Instance().Unmarshall(context); } else if (context.TestExpression("Bucket", num)) { analyticsS3BucketDestination.BucketName = StringUnmarshaller.get_Instance().Unmarshall(context); } else if (context.TestExpression("Prefix", num)) { analyticsS3BucketDestination.Prefix = StringUnmarshaller.get_Instance().Unmarshall(context); } } else if (context.get_IsEndElement() && context.get_CurrentDepth() < currentDepth) { return(analyticsS3BucketDestination); } } return(analyticsS3BucketDestination); }
public IRequest Marshall(ListMultipartUploadsRequest listMultipartUploadsRequest) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown IRequest val = new DefaultRequest(listMultipartUploadsRequest, "AmazonS3"); val.set_HttpMethod("GET"); val.set_ResourcePath("/" + S3Transforms.ToStringValue(listMultipartUploadsRequest.BucketName)); val.AddSubResource("uploads"); if (listMultipartUploadsRequest.IsSetDelimiter()) { val.get_Parameters().Add("delimiter", S3Transforms.ToStringValue(listMultipartUploadsRequest.Delimiter)); } if (listMultipartUploadsRequest.IsSetKeyMarker()) { val.get_Parameters().Add("key-marker", S3Transforms.ToStringValue(listMultipartUploadsRequest.KeyMarker)); } if (listMultipartUploadsRequest.IsSetMaxUploads()) { val.get_Parameters().Add("max-uploads", S3Transforms.ToStringValue(listMultipartUploadsRequest.MaxUploads)); } if (listMultipartUploadsRequest.IsSetPrefix()) { val.get_Parameters().Add("prefix", S3Transforms.ToStringValue(listMultipartUploadsRequest.Prefix)); } if (listMultipartUploadsRequest.IsSetUploadIdMarker()) { val.get_Parameters().Add("upload-id-marker", S3Transforms.ToStringValue(listMultipartUploadsRequest.UploadIdMarker)); } if (listMultipartUploadsRequest.IsSetEncoding()) { val.get_Parameters().Add("encoding-type", S3Transforms.ToStringValue(ConstantClass.op_Implicit(listMultipartUploadsRequest.Encoding))); } val.set_UseQueryString(true); return(val); }
public void AddConstantClass(ConstantClass constantClass) { constantClasses.Add(constantClass); router.Add(constantClasses.Count); }
public static RequestPayer FindValue(string value) { return(ConstantClass.FindValue <RequestPayer>(value)); }
public static BucketAccelerateStatus FindValue(string value) { return(ConstantClass.FindValue <BucketAccelerateStatus>(value)); }
public IRequest Marshall(GetObjectRequest getObjectRequest) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown if (string.IsNullOrEmpty(getObjectRequest.Key)) { throw new ArgumentException("Key is a required property and must be set before making this call.", "GetObjectRequest.Key"); } IRequest val = new DefaultRequest(getObjectRequest, "AmazonS3"); val.set_HttpMethod("GET"); if (getObjectRequest.IsSetEtagToMatch()) { val.get_Headers().Add("If-Match", S3Transforms.ToStringValue(getObjectRequest.EtagToMatch)); } if (getObjectRequest.IsSetModifiedSinceDate()) { val.get_Headers().Add("If-Modified-Since", S3Transforms.ToStringValue(getObjectRequest.ModifiedSinceDate)); } if (getObjectRequest.IsSetEtagToNotMatch()) { val.get_Headers().Add("If-None-Match", S3Transforms.ToStringValue(getObjectRequest.EtagToNotMatch)); } if (getObjectRequest.IsSetUnmodifiedSinceDate()) { val.get_Headers().Add("If-Unmodified-Since", S3Transforms.ToStringValue(getObjectRequest.UnmodifiedSinceDate)); } if (getObjectRequest.IsSetByteRange()) { val.get_Headers().Add("Range", getObjectRequest.ByteRange.FormattedByteRange); } if (getObjectRequest.IsSetServerSideEncryptionCustomerMethod()) { val.get_Headers().Add("x-amz-server-side-encryption-customer-algorithm", ConstantClass.op_Implicit(getObjectRequest.ServerSideEncryptionCustomerMethod)); } if (getObjectRequest.IsSetServerSideEncryptionCustomerProvidedKey()) { val.get_Headers().Add("x-amz-server-side-encryption-customer-key", getObjectRequest.ServerSideEncryptionCustomerProvidedKey); if (getObjectRequest.IsSetServerSideEncryptionCustomerProvidedKeyMD5()) { val.get_Headers().Add("x-amz-server-side-encryption-customer-key-MD5", getObjectRequest.ServerSideEncryptionCustomerProvidedKeyMD5); } else { val.get_Headers().Add("x-amz-server-side-encryption-customer-key-MD5", AmazonS3Util.ComputeEncodedMD5FromEncodedString(getObjectRequest.ServerSideEncryptionCustomerProvidedKey)); } } if (getObjectRequest.IsSetRequestPayer()) { val.get_Headers().Add(S3Constants.AmzHeaderRequestPayer, S3Transforms.ToStringValue(((object)getObjectRequest.RequestPayer).ToString())); } val.set_ResourcePath(string.Format(CultureInfo.InvariantCulture, "/{0}/{1}", S3Transforms.ToStringValue(getObjectRequest.BucketName), S3Transforms.ToStringValue(getObjectRequest.Key))); ResponseHeaderOverrides responseHeaderOverrides = getObjectRequest.ResponseHeaderOverrides; if (responseHeaderOverrides.CacheControl != null) { val.get_Parameters().Add("response-cache-control", S3Transforms.ToStringValue(responseHeaderOverrides.CacheControl)); } if (responseHeaderOverrides.ContentDisposition != null) { val.get_Parameters().Add("response-content-disposition", S3Transforms.ToStringValue(responseHeaderOverrides.ContentDisposition)); } if (responseHeaderOverrides.ContentEncoding != null) { val.get_Parameters().Add("response-content-encoding", S3Transforms.ToStringValue(responseHeaderOverrides.ContentEncoding)); } if (responseHeaderOverrides.ContentLanguage != null) { val.get_Parameters().Add("response-content-language", S3Transforms.ToStringValue(responseHeaderOverrides.ContentLanguage)); } if (responseHeaderOverrides.ContentType != null) { val.get_Parameters().Add("response-content-type", S3Transforms.ToStringValue(responseHeaderOverrides.ContentType)); } if (getObjectRequest.IsSetResponseExpires()) { val.get_Parameters().Add("response-expires", S3Transforms.ToStringValue(getObjectRequest.ResponseExpires)); } if (getObjectRequest.IsSetVersionId()) { val.AddSubResource("versionId", S3Transforms.ToStringValue(getObjectRequest.VersionId)); } if (getObjectRequest.IsSetPartNumber()) { val.AddSubResource("partNumber", S3Transforms.ToStringValue(getObjectRequest.PartNumber.Value)); } val.set_UseQueryString(true); return(val); }
public static S3StorageClass FindValue(string value) { return(ConstantClass.FindValue <S3StorageClass>(value)); }
public static string FromString(ConstantClass value) { return value == null ? "" : value.Intern().Value; }
public static AnalyticsS3ExportFileFormat FindValue(string value) { return(ConstantClass.FindValue <AnalyticsS3ExportFileFormat>(value)); }
private static void ValidateSseHeaderValue(IRequest request) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (request.get_Headers().TryGetValue("x-amz-server-side-encryption", out string value) && string.Equals(value, ConstantClass.op_Implicit(ServerSideEncryptionMethod.AWSKMS))) { throw new AmazonClientException("Request specifying Server Side Encryption with AWS KMS managed keys can only be transmitted over HTTPS"); } }
public IRequest Marshall(PutBucketAnalyticsConfigurationRequest putBucketAnalyticsConfigurationRequest) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_02c9: Unknown result type (might be due to invalid IL or missing references) IRequest val = new DefaultRequest(putBucketAnalyticsConfigurationRequest, "AmazonS3"); val.set_HttpMethod("PUT"); val.set_ResourcePath("/" + S3Transforms.ToStringValue(putBucketAnalyticsConfigurationRequest.BucketName)); val.AddSubResource("analytics"); if (putBucketAnalyticsConfigurationRequest.IsSetAnalyticsId()) { val.AddSubResource("id", S3Transforms.ToStringValue(putBucketAnalyticsConfigurationRequest.AnalyticsId)); } StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture); using (XmlWriter xmlWriter = XmlWriter.Create(stringWriter, new XmlWriterSettings { Encoding = Encoding.UTF8, OmitXmlDeclaration = true })) { if (putBucketAnalyticsConfigurationRequest.IsSetAnalyticsConfiguration()) { AnalyticsConfiguration analyticsConfiguration = putBucketAnalyticsConfigurationRequest.AnalyticsConfiguration; xmlWriter.WriteStartElement("AnalyticsConfiguration", "http://s3.amazonaws.com/doc/2006-03-01/"); if (analyticsConfiguration.IsSetAnalyticsId()) { xmlWriter.WriteElementString("Id", "http://s3.amazonaws.com/doc/2006-03-01/", analyticsConfiguration.AnalyticsId); } if (analyticsConfiguration.IsSetAnalyticsFilter()) { xmlWriter.WriteStartElement("Filter", "http://s3.amazonaws.com/doc/2006-03-01/"); analyticsConfiguration.AnalyticsFilter.AnalyticsFilterPredicate.Accept(new AnalyticsPredicateVisitor(xmlWriter)); xmlWriter.WriteEndElement(); } if (analyticsConfiguration.IsSetStorageClassAnalysis() && analyticsConfiguration.IsSetStorageClassAnalysis()) { StorageClassAnalysis storageClassAnalysis = analyticsConfiguration.StorageClassAnalysis; xmlWriter.WriteStartElement("StorageClassAnalysis", "http://s3.amazonaws.com/doc/2006-03-01/"); if (storageClassAnalysis.IsSetDataExport()) { xmlWriter.WriteStartElement("DataExport", "http://s3.amazonaws.com/doc/2006-03-01/"); StorageClassAnalysisDataExport dataExport = storageClassAnalysis.DataExport; if (dataExport.IsSetOutputSchemaVersion()) { StorageClassAnalysisSchemaVersion outputSchemaVersion = dataExport.OutputSchemaVersion; if (outputSchemaVersion != null) { xmlWriter.WriteElementString("OutputSchemaVersion", "http://s3.amazonaws.com/doc/2006-03-01/", ConstantClass.op_Implicit(outputSchemaVersion)); } } if (dataExport.IsSetDestination()) { xmlWriter.WriteStartElement("Destination", "http://s3.amazonaws.com/doc/2006-03-01/"); AnalyticsExportDestination destination = dataExport.Destination; if (destination.IsSetS3BucketDestination()) { xmlWriter.WriteStartElement("S3BucketDestination", "http://s3.amazonaws.com/doc/2006-03-01/"); AnalyticsS3BucketDestination s3BucketDestination = destination.S3BucketDestination; if (s3BucketDestination.IsSetFormat()) { xmlWriter.WriteElementString("Format", "http://s3.amazonaws.com/doc/2006-03-01/", s3BucketDestination.Format); } if (s3BucketDestination.IsSetBucketAccountId()) { xmlWriter.WriteElementString("BucketAccountId", "http://s3.amazonaws.com/doc/2006-03-01/", s3BucketDestination.BucketAccountId); } if (s3BucketDestination.IsSetBucketName()) { xmlWriter.WriteElementString("Bucket", "http://s3.amazonaws.com/doc/2006-03-01/", s3BucketDestination.BucketName); } if (s3BucketDestination.IsSetPrefix()) { xmlWriter.WriteElementString("Prefix", "http://s3.amazonaws.com/doc/2006-03-01/", s3BucketDestination.Prefix); } xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); } } try { string text = stringWriter.ToString(); val.set_Content(Encoding.UTF8.GetBytes(text)); val.get_Headers()["Content-Type"] = "application/xml"; string value = AmazonS3Util.GenerateChecksumForContent(text, fBase64Encode: true); val.get_Headers()["Content-MD5"] = value; return(val); } catch (EncoderFallbackException ex) { throw new AmazonServiceException("Unable to marshall request to XML", (Exception)ex); } }
public static InventoryIncludedObjectVersions FindValue(string value) { return(ConstantClass.FindValue <InventoryIncludedObjectVersions>(value)); }
private static void ConstantClassExporter(ConstantClass constantClass, JsonWriter writer) { writer.Write(constantClass.Value); }
public IRequest Marshall(PutBucketReplicationRequest putBucketreplicationRequest) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_026a: Unknown result type (might be due to invalid IL or missing references) IRequest val = new DefaultRequest(putBucketreplicationRequest, "AmazonS3"); val.set_HttpMethod("PUT"); val.set_ResourcePath("/" + S3Transforms.ToStringValue(putBucketreplicationRequest.BucketName)); val.AddSubResource("replication"); StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture); using (XmlWriter xmlWriter = XmlWriter.Create(stringWriter, new XmlWriterSettings { Encoding = Encoding.UTF8, OmitXmlDeclaration = true })) { ReplicationConfiguration configuration = putBucketreplicationRequest.Configuration; if (configuration != null) { xmlWriter.WriteStartElement("ReplicationConfiguration", ""); if (configuration.Role != null) { xmlWriter.WriteElementString("Role", "", S3Transforms.ToXmlStringValue(configuration.Role)); } if (configuration.Rules != null) { foreach (ReplicationRule rule in configuration.Rules) { xmlWriter.WriteStartElement("Rule"); if (rule.IsSetId()) { xmlWriter.WriteElementString("ID", "", S3Transforms.ToXmlStringValue(rule.Id)); } if (rule.IsSetPrefix()) { xmlWriter.WriteElementString("Prefix", "", S3Transforms.ToXmlStringValue(rule.Prefix)); } else { xmlWriter.WriteElementString("Prefix", "", S3Transforms.ToXmlStringValue("")); } if (rule.IsSetStatus()) { xmlWriter.WriteElementString("Status", "", S3Transforms.ToXmlStringValue(((object)rule.Status).ToString())); } if (rule.IsSetDestination()) { xmlWriter.WriteStartElement("Destination", ""); if (rule.Destination.IsSetBucketArn()) { xmlWriter.WriteElementString("Bucket", "", rule.Destination.BucketArn); } if (rule.Destination.IsSetStorageClass()) { xmlWriter.WriteElementString("StorageClass", "", ConstantClass.op_Implicit(rule.Destination.StorageClass)); } xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); } } xmlWriter.WriteEndElement(); } } try { string text = stringWriter.ToString(); val.set_Content(Encoding.UTF8.GetBytes(text)); val.get_Headers()["Content-Type"] = "application/xml"; string value = AmazonS3Util.GenerateChecksumForContent(text, fBase64Encode: true); val.get_Headers()["Content-MD5"] = value; return val; } catch (EncoderFallbackException ex) { throw new AmazonServiceException("Unable to marshall request to XML", (Exception)ex); } }
public IRequest Marshall(UploadPartRequest uploadPartRequest) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Expected O, but got Unknown //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Expected O, but got Unknown IRequest val = new DefaultRequest(uploadPartRequest, "AmazonS3"); val.set_HttpMethod("PUT"); if (uploadPartRequest.IsSetMD5Digest()) { val.get_Headers()["Content-MD5"] = uploadPartRequest.MD5Digest; } if (uploadPartRequest.IsSetServerSideEncryptionCustomerMethod()) { val.get_Headers().Add("x-amz-server-side-encryption-customer-algorithm", ConstantClass.op_Implicit(uploadPartRequest.ServerSideEncryptionCustomerMethod)); } if (uploadPartRequest.IsSetServerSideEncryptionCustomerProvidedKey()) { val.get_Headers().Add("x-amz-server-side-encryption-customer-key", uploadPartRequest.ServerSideEncryptionCustomerProvidedKey); if (uploadPartRequest.IsSetServerSideEncryptionCustomerProvidedKeyMD5()) { val.get_Headers().Add("x-amz-server-side-encryption-customer-key-MD5", uploadPartRequest.ServerSideEncryptionCustomerProvidedKeyMD5); } else { val.get_Headers().Add("x-amz-server-side-encryption-customer-key-MD5", AmazonS3Util.ComputeEncodedMD5FromEncodedString(uploadPartRequest.ServerSideEncryptionCustomerProvidedKey)); } } if (uploadPartRequest.IsSetRequestPayer()) { val.get_Headers().Add(S3Constants.AmzHeaderRequestPayer, S3Transforms.ToStringValue(((object)uploadPartRequest.RequestPayer).ToString())); } val.set_ResourcePath(string.Format(CultureInfo.InvariantCulture, "/{0}/{1}", S3Transforms.ToStringValue(uploadPartRequest.BucketName), S3Transforms.ToStringValue(uploadPartRequest.Key))); if (uploadPartRequest.IsSetPartNumber()) { val.AddSubResource("partNumber", S3Transforms.ToStringValue(uploadPartRequest.PartNumber)); } if (uploadPartRequest.IsSetUploadId()) { val.AddSubResource("uploadId", S3Transforms.ToStringValue(uploadPartRequest.UploadId)); } if (uploadPartRequest.InputStream != null) { PartialWrapperStream val2 = new PartialWrapperStream(uploadPartRequest.InputStream, uploadPartRequest.PartSize); if (((Stream)val2).Length > 0) { val.set_UseChunkEncoding(true); } if (!val.get_Headers().ContainsKey("Content-Length")) { val.get_Headers().Add("Content-Length", ((Stream)val2).Length.ToString(CultureInfo.InvariantCulture)); } MD5Stream val3 = uploadPartRequest.InputStream = (Stream) new MD5Stream((Stream)val2, (byte[])null, ((Stream)val2).Length); } val.set_ContentStream(uploadPartRequest.InputStream); if (!val.get_Headers().ContainsKey("Content-Type")) { val.get_Headers().Add("Content-Type", "text/plain"); } return(val); }
public static InventoryFormat FindValue(string value) { return(ConstantClass.FindValue <InventoryFormat>(value)); }
public static ReplicationRuleStatus FindValue(string value) { return(ConstantClass.FindValue <ReplicationRuleStatus>(value)); }
public static string FromString(ConstantClass value) { return(value == null ? "" : value.Intern().Value); }
public static GlacierJobTier FindValue(string value) { return(ConstantClass.FindValue <GlacierJobTier>(value)); }
public IRequest Marshall(CopyPartRequest copyPartRequest) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown IRequest val = new DefaultRequest(copyPartRequest, "AmazonS3"); val.set_HttpMethod("PUT"); if (copyPartRequest.IsSetSourceBucket()) { val.get_Headers().Add("x-amz-copy-source", ConstructCopySourceHeaderValue(copyPartRequest.SourceBucket, copyPartRequest.SourceKey, copyPartRequest.SourceVersionId)); } if (copyPartRequest.IsSetETagToMatch()) { val.get_Headers().Add("x-amz-copy-source-if-match", AWSSDKUtils.Join(copyPartRequest.ETagToMatch)); } if (copyPartRequest.IsSetETagToNotMatch()) { val.get_Headers().Add("x-amz-copy-source-if-none-match", AWSSDKUtils.Join(copyPartRequest.ETagsToNotMatch)); } if (copyPartRequest.IsSetModifiedSinceDate()) { val.get_Headers().Add("x-amz-copy-source-if-modified-since", copyPartRequest.ModifiedSinceDate.ToUniversalTime().ToString("ddd, dd MMM yyyy HH:mm:ss \\G\\M\\T", CultureInfo.InvariantCulture)); } if (copyPartRequest.IsSetUnmodifiedSinceDate()) { val.get_Headers().Add("x-amz-copy-source-if-unmodified-since", copyPartRequest.UnmodifiedSinceDate.ToUniversalTime().ToString("ddd, dd MMM yyyy HH:mm:ss \\G\\M\\T", CultureInfo.InvariantCulture)); } if (copyPartRequest.IsSetServerSideEncryptionCustomerMethod()) { val.get_Headers().Add("x-amz-server-side-encryption-customer-algorithm", ConstantClass.op_Implicit(copyPartRequest.ServerSideEncryptionCustomerMethod)); } if (copyPartRequest.IsSetServerSideEncryptionCustomerProvidedKey()) { val.get_Headers().Add("x-amz-server-side-encryption-customer-key", copyPartRequest.ServerSideEncryptionCustomerProvidedKey); if (copyPartRequest.IsSetServerSideEncryptionCustomerProvidedKeyMD5()) { val.get_Headers().Add("x-amz-server-side-encryption-customer-key-MD5", copyPartRequest.ServerSideEncryptionCustomerProvidedKeyMD5); } else { val.get_Headers().Add("x-amz-server-side-encryption-customer-key-MD5", AmazonS3Util.ComputeEncodedMD5FromEncodedString(copyPartRequest.ServerSideEncryptionCustomerProvidedKey)); } } if (copyPartRequest.IsSetCopySourceServerSideEncryptionCustomerMethod()) { val.get_Headers().Add("x-amz-copy-source-server-side-encryption-customer-algorithm", ConstantClass.op_Implicit(copyPartRequest.CopySourceServerSideEncryptionCustomerMethod)); } if (copyPartRequest.IsSetCopySourceServerSideEncryptionCustomerProvidedKey()) { val.get_Headers().Add("x-amz-copy-source-server-side-encryption-customer-key", copyPartRequest.CopySourceServerSideEncryptionCustomerProvidedKey); if (copyPartRequest.IsSetCopySourceServerSideEncryptionCustomerProvidedKeyMD5()) { val.get_Headers().Add("x-amz-copy-source-server-side-encryption-customer-key-MD5", copyPartRequest.CopySourceServerSideEncryptionCustomerProvidedKeyMD5); } else { val.get_Headers().Add("x-amz-copy-source-server-side-encryption-customer-key-MD5", AmazonS3Util.ComputeEncodedMD5FromEncodedString(copyPartRequest.CopySourceServerSideEncryptionCustomerProvidedKey)); } } if (copyPartRequest.IsSetServerSideEncryptionKeyManagementServiceKeyId()) { val.get_Headers().Add("x-amz-server-side-encryption-aws-kms-key-id", copyPartRequest.ServerSideEncryptionKeyManagementServiceKeyId); } if (copyPartRequest.IsSetFirstByte() && copyPartRequest.IsSetLastByte()) { val.get_Headers().Add("x-amz-copy-source-range", ConstructCopySourceRangeHeader(copyPartRequest.FirstByte, copyPartRequest.LastByte)); } val.set_ResourcePath(string.Format(CultureInfo.InvariantCulture, "/{0}/{1}", S3Transforms.ToStringValue(copyPartRequest.DestinationBucket), S3Transforms.ToStringValue(copyPartRequest.DestinationKey))); val.AddSubResource("partNumber", S3Transforms.ToStringValue(copyPartRequest.PartNumber)); val.AddSubResource("uploadId", S3Transforms.ToStringValue(copyPartRequest.UploadId)); val.set_UseQueryString(true); return(val); }
public static RequestCharged FindValue(string value) { return(ConstantClass.FindValue <RequestCharged>(value)); }