/// <summary>
 /// Exports assets with time and resource types to a given Cloud Storage
 /// location. The output format is newline-delimited JSON.
 /// This API implements the
 /// [google.longrunning.Operation][google.longrunning.Operation] API allowing
 /// you to keep track of the export.
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The response received from the server.</returns>
 public virtual global::Google.LongRunning.Operation ExportAssets(global::Google.Cloud.Asset.V1Beta1.ExportAssetsRequest request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(ExportAssets(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
 /// <summary>
 /// Waits for the specified long-running operation until it is done or reaches
 /// at most a specified timeout, returning the latest state.  If the operation
 /// is already done, the latest state is immediately returned.  If the timeout
 /// specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
 /// timeout is used.  If the server does not support this method, it returns
 /// `google.rpc.Code.UNIMPLEMENTED`.
 /// Note that this method is on a best-effort basis.  It may return the latest
 /// state before the specified timeout (including immediately), meaning even an
 /// immediate response is no guarantee that the operation is done.
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The call object.</returns>
 public virtual grpc::AsyncUnaryCall <global::Google.LongRunning.Operation> WaitOperationAsync(global::Google.LongRunning.WaitOperationRequest request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(WaitOperationAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
Exemplo n.º 3
0
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public async System.Threading.Tasks.Task <TodoApiModel> PutAsync(string id, TodoRequestApiModel value, System.Threading.CancellationToken cancellationToken)
        {
            var urlBuilder_ = new System.Text.StringBuilder();

            urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Todo/{id}");
            urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));

            var client_ = _httpClient;

            try
            {
                using (var request_ = new System.Net.Http.HttpRequestMessage())
                {
                    var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(value, _settings.Value));
                    content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
                    request_.Content             = content_;
                    request_.Method = new System.Net.Http.HttpMethod("PUT");
                    request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));

                    PrepareRequest(client_, request_, urlBuilder_);
                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);

                    try
                    {
                        var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                            {
                                headers_[item_.Key] = item_.Value;
                            }
                        }

                        ProcessResponse(client_, response_);

                        var status_ = ((int)response_.StatusCode).ToString();
                        if (status_ == "200")
                        {
                            var objectResponse_ = await ReadObjectResponseAsync <TodoApiModel>(response_, headers_).ConfigureAwait(false);

                            return(objectResponse_.Object);
                        }
                        else
                        if (status_ != "200" && status_ != "204")
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);

                            throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
                        }

                        return(default(TodoApiModel));
                    }
                    finally
                    {
                        if (response_ != null)
                        {
                            response_.Dispose();
                        }
                    }
                }
            }
            finally
            {
            }
        }
 /// <summary>
 /// Returns the requested ad group criterion simulation in full detail.
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The response received from the server.</returns>
 public virtual global::Google.Ads.GoogleAds.V2.Resources.AdGroupCriterionSimulation GetAdGroupCriterionSimulation(global::Google.Ads.GoogleAds.V2.Services.GetAdGroupCriterionSimulationRequest request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(GetAdGroupCriterionSimulation(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
 /// <summary>
 /// Lists operations that match the specified filter in the request. If the
 /// server doesn't support this method, it returns `UNIMPLEMENTED`.
 ///
 /// NOTE: the `name` binding allows API services to override the binding
 /// to use different resource name schemes, such as `users/*/operations`. To
 /// override the binding, API services can add a binding such as
 /// `"/v1/{name=users/*}/operations"` to their service configuration.
 /// For backwards compatibility, the default name includes the operations
 /// collection id, however overriding users must ensure the name binding
 /// is the parent resource, without the operations collection id.
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The response received from the server.</returns>
 public virtual global::Google.LongRunning.ListOperationsResponse ListOperations(global::Google.LongRunning.ListOperationsRequest request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(ListOperations(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
Exemplo n.º 6
0
 /// <summary>
 /// Returns the requested campaign criterion simulation in full detail.
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The call object.</returns>
 public virtual grpc::AsyncUnaryCall <global::Google.Ads.GoogleAds.V4.Resources.CampaignCriterionSimulation> GetCampaignCriterionSimulationAsync(global::Google.Ads.GoogleAds.V4.Services.GetCampaignCriterionSimulationRequest request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(GetCampaignCriterionSimulationAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
Exemplo n.º 7
0
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>Success</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public async System.Threading.Tasks.Task <System.Collections.Generic.ICollection <WeatherForecast> > WeatherforecastAsync(int?i, System.Threading.CancellationToken cancellationToken)
        {
            var urlBuilder_ = new System.Text.StringBuilder();

            urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/WeatherForecast?");
            if (i != null)
            {
                urlBuilder_.Append(System.Uri.EscapeDataString("i") + "=").Append(System.Uri.EscapeDataString(ConvertToString(i, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
            }
            urlBuilder_.Length--;

            var client_        = _httpClient;
            var disposeClient_ = false;

            try
            {
                using (var request_ = new System.Net.Http.HttpRequestMessage())
                {
                    request_.Method = new System.Net.Http.HttpMethod("GET");
                    request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));

                    PrepareRequest(client_, request_, urlBuilder_);
                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);

                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                            {
                                headers_[item_.Key] = item_.Value;
                            }
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var objectResponse_ = await ReadObjectResponseAsync <System.Collections.Generic.ICollection <WeatherForecast> >(response_, headers_).ConfigureAwait(false);

                            if (objectResponse_.Object == null)
                            {
                                throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
                            }
                            return(objectResponse_.Object);
                        }
                        else
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);

                            throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                        {
                            response_.Dispose();
                        }
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                {
                    client_.Dispose();
                }
            }
        }
 public static global::System.Threading.Tasks.Task <TResult> AsTask <TResult, TProgress>(this global::Windows.Foundation.IAsyncOperationWithProgress <TResult, TProgress> source, global::System.Threading.CancellationToken cancellationToken, global::System.IProgress <TProgress> progress)
 {
     throw null;
 }
Exemplo n.º 9
0
 public virtual global::MessageShared.mLogTextResult writeLogText(global::MessageShared.mLogText request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(writeLogText(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
Exemplo n.º 10
0
 public static global::System.Threading.Tasks.Task AsTask <TProgress>(this global::Windows.Foundation.IAsyncActionWithProgress <TProgress> source, global::System.Threading.CancellationToken cancellationToken)
 {
     throw null;
 }
Exemplo n.º 11
0
 public static global::System.Threading.Tasks.Task <TResult> AsTask <TResult>(this global::Windows.Foundation.IAsyncOperation <TResult> source, global::System.Threading.CancellationToken cancellationToken)
 {
     throw null;
 }
Exemplo n.º 12
0
 /// <summary>
 /// Updates the breakpoint state or mutable fields.
 /// The entire Breakpoint message must be sent back to the controller service.
 ///
 /// Updates to active breakpoint fields are only allowed if the new value
 /// does not change the breakpoint specification. Updates to the `location`,
 /// `condition` and `expressions` fields should not alter the breakpoint
 /// semantics. These may only make changes such as canonicalizing a value
 /// or snapping the location to the correct line of code.
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The call object.</returns>
 public virtual grpc::AsyncUnaryCall <global::Google.Cloud.Debugger.V2.UpdateActiveBreakpointResponse> UpdateActiveBreakpointAsync(global::Google.Cloud.Debugger.V2.UpdateActiveBreakpointRequest request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(UpdateActiveBreakpointAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
Exemplo n.º 13
0
 /// <summary>
 /// Returns the list of all active breakpoints for the debuggee.
 ///
 /// The breakpoint specification (`location`, `condition`, and `expressions`
 /// fields) is semantically immutable, although the field values may
 /// change. For example, an agent may update the location line number
 /// to reflect the actual line where the breakpoint was set, but this
 /// doesn't change the breakpoint semantics.
 ///
 /// This means that an agent does not need to check if a breakpoint has changed
 /// when it encounters the same breakpoint on a successive call.
 /// Moreover, an agent should remember the breakpoints that are completed
 /// until the controller removes them from the active list to avoid
 /// setting those breakpoints again.
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The response received from the server.</returns>
 public virtual global::Google.Cloud.Debugger.V2.ListActiveBreakpointsResponse ListActiveBreakpoints(global::Google.Cloud.Debugger.V2.ListActiveBreakpointsRequest request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(ListActiveBreakpoints(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
 /// <summary>
 /// Batch gets the update history of assets that overlap a time window.
 /// For RESOURCE content, this API outputs history with asset in both
 /// non-delete or deleted status.
 /// For IAM_POLICY content, this API outputs history when the asset and its
 /// attached IAM POLICY both exist. This can create gaps in the output history.
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The call object.</returns>
 public virtual grpc::AsyncUnaryCall <global::Google.Cloud.Asset.V1Beta1.BatchGetAssetsHistoryResponse> BatchGetAssetsHistoryAsync(global::Google.Cloud.Asset.V1Beta1.BatchGetAssetsHistoryRequest request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(BatchGetAssetsHistoryAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
Exemplo n.º 15
0
 /// <summary>
 /// Deletes specified company.
 /// Prerequisite: The company has no jobs associated with it.
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The call object.</returns>
 public virtual grpc::AsyncUnaryCall <global::Google.Protobuf.WellKnownTypes.Empty> DeleteCompanyAsync(global::Google.Cloud.Talent.V4Beta1.DeleteCompanyRequest request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(DeleteCompanyAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
Exemplo n.º 16
0
 /// <summary>
 /// Returns the requested Managed Placement view in full detail.
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The call object.</returns>
 public virtual grpc::AsyncUnaryCall <global::Google.Ads.GoogleAds.V5.Resources.ManagedPlacementView> GetManagedPlacementViewAsync(global::Google.Ads.GoogleAds.V5.Services.GetManagedPlacementViewRequest request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(GetManagedPlacementViewAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
Exemplo n.º 17
0
 /// <summary>
 /// Lists all companies associated with the project.
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The call object.</returns>
 public virtual grpc::AsyncUnaryCall <global::Google.Cloud.Talent.V4Beta1.ListCompaniesResponse> ListCompaniesAsync(global::Google.Cloud.Talent.V4Beta1.ListCompaniesRequest request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(ListCompaniesAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
Exemplo n.º 18
0
 /// <summary>
 /// Service to query async result by using the async key
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The call object.</returns>
 public virtual grpc::AsyncUnaryCall <global::G2Rail.Protobuf.OnlineSolutionsResponse> QueryAsyncOnlineSolutionsAsync(global::G2Rail.Protobuf.OnlineSolutionsAsyncQueryRequest request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(QueryAsyncOnlineSolutionsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
Exemplo n.º 19
0
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>Success</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public async System.Threading.Tasks.Task <bool> CourseAddstudentscourseAsync(StudentCoursesDto body, System.Threading.CancellationToken cancellationToken)
        {
            var urlBuilder_ = new System.Text.StringBuilder();

            urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Course/AddStudentsCourse");

            var client_        = _httpClient;
            var disposeClient_ = false;

            try
            {
                using (var request_ = new System.Net.Http.HttpRequestMessage())
                {
                    var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value));
                    content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
                    request_.Content             = content_;
                    request_.Method = new System.Net.Http.HttpMethod("POST");
                    request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));

                    PrepareRequest(client_, request_, urlBuilder_);
                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);

                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                            {
                                headers_[item_.Key] = item_.Value;
                            }
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var objectResponse_ = await ReadObjectResponseAsync <bool>(response_, headers_).ConfigureAwait(false);

                            if (objectResponse_.Object == null)
                            {
                                throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
                            }
                            return(objectResponse_.Object);
                        }
                        else
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);

                            throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                        {
                            response_.Dispose();
                        }
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                {
                    client_.Dispose();
                }
            }
        }
Exemplo n.º 20
0
 /// <summary>
 /// Send a search request
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The response received from the server.</returns>
 public virtual global::G2Rail.Protobuf.AsyncKeyResponse Search(global::G2Rail.Protobuf.SearchRequest request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(Search(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
Exemplo n.º 21
0
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>Success</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public async System.Threading.Tasks.Task <bool> CourseUploaddocAsync(FileParameter input, System.Threading.CancellationToken cancellationToken)
        {
            var urlBuilder_ = new System.Text.StringBuilder();

            urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Course/UploadDoc");

            var client_        = _httpClient;
            var disposeClient_ = false;

            try
            {
                using (var request_ = new System.Net.Http.HttpRequestMessage())
                {
                    var boundary_ = System.Guid.NewGuid().ToString();
                    var content_  = new System.Net.Http.MultipartFormDataContent(boundary_);
                    content_.Headers.Remove("Content-Type");
                    content_.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary_);
                    if (input != null)
                    {
                        var content_input_ = new System.Net.Http.StreamContent(input.Data);
                        if (!string.IsNullOrEmpty(input.ContentType))
                        {
                            content_input_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(input.ContentType);
                        }
                        content_.Add(content_input_, "input", input.FileName ?? "input");
                    }
                    request_.Content = content_;
                    request_.Method  = new System.Net.Http.HttpMethod("POST");
                    request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));

                    PrepareRequest(client_, request_, urlBuilder_);
                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);

                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                            {
                                headers_[item_.Key] = item_.Value;
                            }
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var objectResponse_ = await ReadObjectResponseAsync <bool>(response_, headers_).ConfigureAwait(false);

                            if (objectResponse_.Object == null)
                            {
                                throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
                            }
                            return(objectResponse_.Object);
                        }
                        else
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);

                            throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                        {
                            response_.Dispose();
                        }
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                {
                    client_.Dispose();
                }
            }
        }
 /// <summary>
 /// Creates or removes feed mappings. Operation statuses are
 /// returned.
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The response received from the server.</returns>
 public virtual global::Google.Ads.GoogleAds.V4.Services.MutateFeedMappingsResponse MutateFeedMappings(global::Google.Ads.GoogleAds.V4.Services.MutateFeedMappingsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
   return MutateFeedMappings(request, new grpc::CallOptions(headers, deadline, cancellationToken));
 }
Exemplo n.º 23
0
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public async System.Threading.Tasks.Task <AnswerPayload> GetByParameterNameAsync(string parameterName, System.Threading.CancellationToken cancellationToken)
        {
            var urlBuilder_ = new System.Text.StringBuilder();

            urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/v2-feature1/qa/get-value-for-parameter?");
            if (parameterName != null)
            {
                urlBuilder_.Append(System.Uri.EscapeDataString("parameterName") + "=").Append(System.Uri.EscapeDataString(ConvertToString(parameterName, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
            }
            urlBuilder_.Length--;

            var client_ = _httpClient;

            try
            {
                using (var request_ = new System.Net.Http.HttpRequestMessage())
                {
                    request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json");
                    request_.Method  = new System.Net.Http.HttpMethod("POST");
                    request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));

                    PrepareRequest(client_, request_, urlBuilder_);
                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);

                    try
                    {
                        var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                            {
                                headers_[item_.Key] = item_.Value;
                            }
                        }

                        ProcessResponse(client_, response_);

                        var status_ = ((int)response_.StatusCode).ToString();
                        if (status_ == "200")
                        {
                            var objectResponse_ = await ReadObjectResponseAsync <AnswerPayload>(response_, headers_).ConfigureAwait(false);

                            return(objectResponse_.Object);
                        }
                        else
                        if (status_ == "400")
                        {
                            var objectResponse_ = await ReadObjectResponseAsync <string>(response_, headers_).ConfigureAwait(false);

                            throw new ApiException <string>("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null);
                        }
                        else
                        if (status_ == "500")
                        {
                            var objectResponse_ = await ReadObjectResponseAsync <ServerError500Response>(response_, headers_).ConfigureAwait(false);

                            throw new ApiException <ServerError500Response>("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null);
                        }
                        else
                        if (status_ != "200" && status_ != "204")
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);

                            throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
                        }

                        return(default(AnswerPayload));
                    }
                    finally
                    {
                        if (response_ != null)
                        {
                            response_.Dispose();
                        }
                    }
                }
            }
            finally
            {
            }
        }
 /// <summary>
 /// Returns the requested feed item set in full detail.
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The response received from the server.</returns>
 public virtual global::Google.Ads.GoogleAds.V6.Resources.FeedItemSet GetFeedItemSet(global::Google.Ads.GoogleAds.V6.Services.GetFeedItemSetRequest request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(GetFeedItemSet(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
Exemplo n.º 25
0
 /// <summary>
 /// Starts asynchronous cancellation on a long-running operation.  The server
 /// makes a best effort to cancel the operation, but success is not
 /// guaranteed.  If the server doesn't support this method, it returns
 /// `google.rpc.Code.UNIMPLEMENTED`.  Clients can use
 /// [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
 /// other methods to check whether the cancellation succeeded or whether the
 /// operation completed despite cancellation. On successful cancellation,
 /// the operation is not deleted; instead, it becomes an operation with
 /// an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
 /// corresponding to `Code.CANCELLED`.
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The response received from the server.</returns>
 public virtual global::Google.Protobuf.WellKnownTypes.Empty CancelOperation(global::Google.LongRunning.CancelOperationRequest request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(CancelOperation(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
 /// <summary>
 /// Creates, updates or removes feed item sets. Operation statuses are
 /// returned.
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The call object.</returns>
 public virtual grpc::AsyncUnaryCall <global::Google.Ads.GoogleAds.V6.Services.MutateFeedItemSetsResponse> MutateFeedItemSetsAsync(global::Google.Ads.GoogleAds.V6.Services.MutateFeedItemSetsRequest request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(MutateFeedItemSetsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
Exemplo n.º 27
0
 public virtual grpc::AsyncUnaryCall <global::HZP.MQ.AdminManager.TestReply> SayHelloAsync(global::HZP.MQ.AdminManager.TestRequest request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(SayHelloAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
Exemplo n.º 28
0
 /// <summary>
 /// Updates specified company.
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The response received from the server.</returns>
 public virtual global::Google.Cloud.Talent.V4Beta1.Company UpdateCompany(global::Google.Cloud.Talent.V4Beta1.UpdateCompanyRequest request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(UpdateCompany(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }
Exemplo n.º 29
0
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public async System.Threading.Tasks.Task <System.Collections.Generic.ICollection <TodoApiModel> > GetAllAsync(System.Threading.CancellationToken cancellationToken)
        {
            var urlBuilder_ = new System.Text.StringBuilder();

            urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Todo");

            var client_ = _httpClient;

            try
            {
                using (var request_ = new System.Net.Http.HttpRequestMessage())
                {
                    request_.Method = new System.Net.Http.HttpMethod("GET");
                    request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));

                    PrepareRequest(client_, request_, urlBuilder_);
                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);

                    try
                    {
                        var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                            {
                                headers_[item_.Key] = item_.Value;
                            }
                        }

                        ProcessResponse(client_, response_);

                        var status_ = ((int)response_.StatusCode).ToString();
                        if (status_ == "200")
                        {
                            var objectResponse_ = await ReadObjectResponseAsync <System.Collections.Generic.ICollection <TodoApiModel> >(response_, headers_).ConfigureAwait(false);

                            return(objectResponse_.Object);
                        }
                        else
                        if (status_ != "200" && status_ != "204")
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);

                            throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
                        }

                        return(default(System.Collections.Generic.ICollection <TodoApiModel>));
                    }
                    finally
                    {
                        if (response_ != null)
                        {
                            response_.Dispose();
                        }
                    }
                }
            }
            finally
            {
            }
        }
Exemplo n.º 30
0
 /// <summary>
 /// Creates, updates, or removes criteria. Operation statuses are returned.
 ///
 /// List of thrown errors:
 ///   [AdxError]()
 ///   [AuthenticationError]()
 ///   [AuthorizationError]()
 ///   [CampaignCriterionError]()
 ///   [CollectionSizeError]()
 ///   [ContextError]()
 ///   [CriterionError]()
 ///   [DatabaseError]()
 ///   [DistinctError]()
 ///   [FieldError]()
 ///   [FieldMaskError]()
 ///   [FunctionError]()
 ///   [HeaderError]()
 ///   [IdError]()
 ///   [InternalError]()
 ///   [MutateError]()
 ///   [NewResourceCreationError]()
 ///   [NotEmptyError]()
 ///   [NullError]()
 ///   [OperationAccessDeniedError]()
 ///   [OperatorError]()
 ///   [QuotaError]()
 ///   [RangeError]()
 ///   [RegionCodeError]()
 ///   [RequestError]()
 ///   [ResourceCountLimitExceededError]()
 ///   [SizeLimitError]()
 ///   [StringFormatError]()
 ///   [StringLengthError]()
 /// </summary>
 /// <param name="request">The request to send to the server.</param>
 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
 /// <param name="cancellationToken">An optional token for canceling the call.</param>
 /// <returns>The response received from the server.</returns>
 public virtual global::Google.Ads.GoogleAds.V7.Services.MutateCampaignCriteriaResponse MutateCampaignCriteria(global::Google.Ads.GoogleAds.V7.Services.MutateCampaignCriteriaRequest request, grpc::Metadata headers = null, global::System.DateTime?deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
 {
     return(MutateCampaignCriteria(request, new grpc::CallOptions(headers, deadline, cancellationToken)));
 }