/// <summary> /// Register a new connector /// </summary> /// <exception cref="Com.Cosmotech.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="connector">the Connector to register</param> /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> /// <returns>Task of ApiResponse (Connector)</returns> public async System.Threading.Tasks.Task <Com.Cosmotech.Client.ApiResponse <Connector> > RegisterConnectorWithHttpInfoAsync(Connector connector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'connector' is set if (connector == null) { throw new Com.Cosmotech.Client.ApiException(400, "Missing required parameter 'connector' when calling ConnectorApi->RegisterConnector"); } Com.Cosmotech.Client.RequestOptions localVarRequestOptions = new Com.Cosmotech.Client.RequestOptions(); String[] _contentTypes = new String[] { "application/json", "application/yaml" }; // to determine the Accept header String[] _accepts = new String[] { "application/json" }; var localVarContentType = Com.Cosmotech.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = Com.Cosmotech.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.Data = connector; // authentication (oAuth2AuthCode) required // oauth required if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } // make the HTTP request var localVarResponse = await this.AsynchronousClient.PostAsync <Connector>("/connectors", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("RegisterConnector", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// Get the details of a connector /// </summary> /// <exception cref="Com.Cosmotech.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="connectorId">the Connector identifier</param> /// <returns>ApiResponse of Connector</returns> public Com.Cosmotech.Client.ApiResponse <Connector> FindConnectorByIdWithHttpInfo(string connectorId) { // verify the required parameter 'connectorId' is set if (connectorId == null) { throw new Com.Cosmotech.Client.ApiException(400, "Missing required parameter 'connectorId' when calling ConnectorApi->FindConnectorById"); } Com.Cosmotech.Client.RequestOptions localVarRequestOptions = new Com.Cosmotech.Client.RequestOptions(); String[] _contentTypes = new String[] { }; // to determine the Accept header String[] _accepts = new String[] { "application/json" }; var localVarContentType = Com.Cosmotech.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = Com.Cosmotech.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.PathParameters.Add("connector_id", Com.Cosmotech.Client.ClientUtils.ParameterToString(connectorId)); // path parameter // authentication (oAuth2AuthCode) required // oauth required if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } // make the HTTP request var localVarResponse = this.Client.Get <Connector>("/connectors/{connector_id}", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindConnectorById", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// List all Connectors /// </summary> /// <exception cref="Com.Cosmotech.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> /// <returns>Task of ApiResponse (List<Connector>)</returns> public async System.Threading.Tasks.Task <Com.Cosmotech.Client.ApiResponse <List <Connector> > > FindAllConnectorsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Com.Cosmotech.Client.RequestOptions localVarRequestOptions = new Com.Cosmotech.Client.RequestOptions(); String[] _contentTypes = new String[] { }; // to determine the Accept header String[] _accepts = new String[] { "application/json" }; var localVarContentType = Com.Cosmotech.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = Com.Cosmotech.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } // authentication (oAuth2AuthCode) required // oauth required if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } // make the HTTP request var localVarResponse = await this.AsynchronousClient.GetAsync <List <Connector> >("/connectors", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindAllConnectors", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }