// // IRequestBuilder.cs // // Author: // MiNG // // Copyright (c) 2018 Alibaba Cloud // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Net.Http; using Aliyun.Api.LogService.Infrastructure.Authentication; namespace Aliyun.Api.LogService.Infrastructure.Protocol { /// /// The builder for constructing request . /// /// The type of building request. public interface IRequestBuilder { /// /// Adds query of request. /// /// The key of query. /// The value of query. /// This builder. /// has already been exist. IRequestBuilder Query(String key, String value); /// /// Add all public gettable properties of to query. /// /// A simple data object with no nested complex properties. /// This builder. /// If has nested complex properties. IRequestBuilder Query(Object queryModel); /// /// Adds header of request. /// /// The key of header. /// The value of header. /// This builder. IRequestBuilder Header(String key, String value); /// /// Sets serialized content of request. /// /// The serialized content. /// This builder. /// IRequestBuilder Content(Byte[] content); /// /// Sets content of request. /// /// The content, can be serialized or not. /// This builder. IRequestBuilder Content(Object content); /// /// Serialize the content. /// /// The serialze type /// This builder. /// If nothing to serialize, or content has already been serialized. IRequestBuilder Serialize(SerializeType serializeType); /// /// Compress the content. /// /// The compress type /// This builder. /// If nothing to compress, or content is not serialized. IRequestBuilder Compress(CompressType compressType); /// /// Set credential to authenticate. /// /// The authenticate credential. /// IRequestBuilder Authenticate(Credential credential); /// /// Specify the signature type and credentials to sign. /// /// The signature type /// This builder. IRequestBuilder Sign(SignatureType signatureType); /// /// Build the request . /// /// The built request. T Build(); } }