Beispiel #1
0
        internal void ModifyRequest(UpdateRequest request)
        {
            if (IfMetagenerationMatch != null && IfMetagenerationNotMatch != null)
            {
                throw new ArgumentException($"Cannot specify {nameof(IfMetagenerationMatch)} and {nameof(IfMetagenerationNotMatch)} in the same options", "options");
            }

            if (IfMetagenerationMatch != null)
            {
                request.IfMetagenerationMatch = IfMetagenerationMatch;
            }
            if (IfMetagenerationNotMatch != null)
            {
                request.IfMetagenerationNotMatch = IfMetagenerationNotMatch;
            }
            if (Projection != null)
            {
                request.Projection = GaxRestPreconditions.CheckEnumValue((ProjectionEnum)Projection, nameof(Projection));
            }
            if (PredefinedAcl != null)
            {
                request.PredefinedAcl =
                    GaxRestPreconditions.CheckEnumValue((PredefinedAclEnum)PredefinedAcl, nameof(PredefinedAcl));
            }
            if (PredefinedDefaultObjectAcl != null)
            {
                request.PredefinedDefaultObjectAcl =
                    GaxRestPreconditions.CheckEnumValue((PredefinedDefaultObjectAclEnum)PredefinedDefaultObjectAcl, nameof(PredefinedDefaultObjectAcl));
            }
        }
Beispiel #2
0
 /// <summary>
 /// Modifies the specified request for all non-null properties of this options object.
 /// </summary>
 /// <param name="request">The request to modify</param>
 internal void ModifyRequest(ListRequest request)
 {
     if (Prefix != null)
     {
         request.Prefix = Prefix;
     }
     if (PageSize != null)
     {
         request.MaxResults = PageSize;
     }
     if (Projection != null)
     {
         request.Projection = GaxRestPreconditions.CheckEnumValue((ProjectionEnum)Projection, nameof(Projection));
     }
 }
Beispiel #3
0
 internal void ModifyRequest(BucketsResource.InsertRequest request)
 {
     if (PredefinedAcl != null)
     {
         request.PredefinedAcl =
             GaxRestPreconditions.CheckEnumValue((PredefinedAclEnum)PredefinedAcl, nameof(PredefinedAcl));
     }
     if (PredefinedDefaultObjectAcl != null)
     {
         request.PredefinedDefaultObjectAcl =
             GaxRestPreconditions.CheckEnumValue((PredefinedDefaultObjectAclEnum)PredefinedDefaultObjectAcl, nameof(PredefinedDefaultObjectAcl));
     }
     if (Projection != null)
     {
         request.Projection = GaxRestPreconditions.CheckEnumValue((ProjectionEnum)Projection, nameof(Projection));
     }
 }
        internal void ModifyMediaUpload(InsertMediaUpload upload)
        {
            // Note the use of ArgumentException here, as this will basically be the result of invalid
            // options being passed to a public method.
            if (IfGenerationMatch != null && IfGenerationNotMatch != null)
            {
                throw new ArgumentException($"Cannot specify {nameof(IfGenerationMatch)} and {nameof(IfGenerationNotMatch)} in the same options", "options");
            }
            if (IfMetagenerationMatch != null && IfMetagenerationNotMatch != null)
            {
                throw new ArgumentException($"Cannot specify {nameof(IfMetagenerationMatch)} and {nameof(IfMetagenerationNotMatch)} in the same options", "options");
            }

            if (ChunkSize != null)
            {
                upload.ChunkSize = ChunkSize.Value;
            }
            if (PredefinedAcl != null)
            {
                upload.PredefinedAcl =
                    GaxRestPreconditions.CheckEnumValue((PredefinedAclEnum)PredefinedAcl, nameof(PredefinedAcl));
            }
            if (IfGenerationMatch != null)
            {
                upload.IfGenerationMatch = IfGenerationMatch;
            }
            if (IfGenerationNotMatch != null)
            {
                upload.IfGenerationNotMatch = IfGenerationNotMatch;
            }
            if (IfMetagenerationMatch != null)
            {
                upload.IfMetagenerationMatch = IfMetagenerationMatch;
            }
            if (IfMetagenerationNotMatch != null)
            {
                upload.IfMetagenerationNotMatch = IfMetagenerationNotMatch;
            }
            if (Projection != null)
            {
                upload.Projection = GaxRestPreconditions.CheckEnumValue((ProjectionEnum)Projection, nameof(Projection));
            }
        }
Beispiel #5
0
        internal void ModifyRequest(PatchRequest request)
        {
            // Note the use of ArgumentException here, as this will basically be the result of invalid
            // options being passed to a public method.
            if (IfGenerationMatch != null && IfGenerationNotMatch != null)
            {
                throw new ArgumentException($"Cannot specify {nameof(IfGenerationMatch)} and {nameof(IfGenerationNotMatch)} in the same options", "options");
            }
            if (IfMetagenerationMatch != null && IfMetagenerationNotMatch != null)
            {
                throw new ArgumentException($"Cannot specify {nameof(IfMetagenerationMatch)} and {nameof(IfMetagenerationNotMatch)} in the same options", "options");
            }

            if (Generation != null)
            {
                request.Generation = Generation;
            }
            if (IfGenerationMatch != null)
            {
                request.IfGenerationMatch = IfGenerationMatch;
            }
            if (IfGenerationNotMatch != null)
            {
                request.IfGenerationNotMatch = IfGenerationNotMatch;
            }
            if (IfMetagenerationMatch != null)
            {
                request.IfMetagenerationMatch = IfMetagenerationMatch;
            }
            if (IfMetagenerationNotMatch != null)
            {
                request.IfMetagenerationNotMatch = IfMetagenerationNotMatch;
            }
            if (Projection != null)
            {
                request.Projection = GaxRestPreconditions.CheckEnumValue((ProjectionEnum)Projection, nameof(Projection));
            }
            if (PredefinedAcl != null)
            {
                request.PredefinedAcl =
                    GaxRestPreconditions.CheckEnumValue((PredefinedAclEnum)PredefinedAcl, nameof(PredefinedAcl));
            }
        }
 /// <summary>
 /// Modifies the specified request for all non-null properties of this options object.
 /// </summary>
 /// <param name="request">The request to modify</param>
 internal void ModifyRequest(ListRequest request)
 {
     if (PageSize != null)
     {
         request.MaxResults = PageSize;
     }
     if (Delimiter != null)
     {
         request.Delimiter = Delimiter;
     }
     if (Versions != null)
     {
         request.Versions = Versions;
     }
     if (Projection != null)
     {
         request.Projection = GaxRestPreconditions.CheckEnumValue((ProjectionEnum)Projection, nameof(Projection));
     }
 }