diff --git a/src/KubernetesClient/generated/IKubernetes.cs b/src/KubernetesClient/generated/IKubernetes.cs index cfb93c9..547ad4c 100644 --- a/src/KubernetesClient/generated/IKubernetes.cs +++ b/src/KubernetesClient/generated/IKubernetes.cs @@ -29121,74 +29121,6 @@ namespace k8s /// Task> GetCodeWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a cluster scoped Custom object - /// - /// - /// The JSON schema of the Resource to create. - /// - /// - /// The custom resource's group name - /// - /// - /// The custom resource's version - /// - /// - /// The custom resource's plural name. For TPRs this would be lowercase - /// plural kind. - /// - /// - /// If 'true', then the output is pretty printed. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - Task> CreateClusterCustomObjectWithHttpMessagesAsync(object body, string group, string version, string plural, string pretty = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// list or watch cluster scoped custom objects - /// - /// - /// The custom resource's group name - /// - /// - /// The custom resource's version - /// - /// - /// The custom resource's plural name. For TPRs this would be lowercase - /// plural kind. - /// - /// - /// A selector to restrict the list of returned objects by their - /// labels. Defaults to everything. - /// - /// - /// When specified with a watch call, shows changes that occur after - /// that particular version of a resource. Defaults to changes from the - /// beginning of history. When specified for list: - if unset, then the - /// result is returned from remote storage based on quorum-read flag; - - /// if it's 0, then we simply return what we currently have in cache, - /// no guarantee; - if set to non zero, then the result is at least as - /// fresh as given rv. - /// - /// - /// Watch for changes to the described resources and return them as a - /// stream of add, update, and remove notifications. - /// - /// - /// If 'true', then the output is pretty printed. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - Task> ListClusterCustomObjectWithHttpMessagesAsync(string group, string version, string plural, string labelSelector = default(string), string resourceVersion = default(string), bool? watch = default(bool?), string pretty = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Creates a namespace scoped Custom object /// @@ -29264,23 +29196,23 @@ namespace k8s Task> ListNamespacedCustomObjectWithHttpMessagesAsync(string group, string version, string namespaceParameter, string plural, string labelSelector = default(string), string resourceVersion = default(string), bool? watch = default(bool?), string pretty = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// replace the specified cluster scoped custom object + /// Creates a cluster scoped Custom object /// /// - /// The JSON schema of the Resource to replace. + /// The JSON schema of the Resource to create. /// /// - /// the custom resource's group + /// The custom resource's group name /// /// - /// the custom resource's version + /// The custom resource's version /// /// - /// the custom object's plural name. For TPRs this would be lowercase + /// The custom resource's plural name. For TPRs this would be lowercase /// plural kind. /// - /// - /// the custom object's name + /// + /// If 'true', then the output is pretty printed. /// /// /// The headers that will be added to request. @@ -29288,26 +29220,40 @@ namespace k8s /// /// The cancellation token. /// - Task> ReplaceClusterCustomObjectWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateClusterCustomObjectWithHttpMessagesAsync(object body, string group, string version, string plural, string pretty = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// patch the specified cluster scoped custom object + /// list or watch cluster scoped custom objects /// - /// - /// The JSON schema of the Resource to patch. - /// /// - /// the custom resource's group + /// The custom resource's group name /// /// - /// the custom resource's version + /// The custom resource's version /// /// - /// the custom object's plural name. For TPRs this would be lowercase + /// The custom resource's plural name. For TPRs this would be lowercase /// plural kind. /// - /// - /// the custom object's name + /// + /// A selector to restrict the list of returned objects by their + /// labels. Defaults to everything. + /// + /// + /// When specified with a watch call, shows changes that occur after + /// that particular version of a resource. Defaults to changes from the + /// beginning of history. When specified for list: - if unset, then the + /// result is returned from remote storage based on quorum-read flag; - + /// if it's 0, then we simply return what we currently have in cache, + /// no guarantee; - if set to non zero, then the result is at least as + /// fresh as given rv. + /// + /// + /// Watch for changes to the described resources and return them as a + /// stream of add, update, and remove notifications. + /// + /// + /// If 'true', then the output is pretty printed. /// /// /// The headers that will be added to request. @@ -29315,10 +29261,10 @@ namespace k8s /// /// The cancellation token. /// - Task> PatchClusterCustomObjectWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListClusterCustomObjectWithHttpMessagesAsync(string group, string version, string plural, string labelSelector = default(string), string resourceVersion = default(string), bool? watch = default(bool?), string pretty = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified cluster scoped custom object + /// replace status of the cluster scoped specified custom object /// /// /// @@ -29329,42 +29275,49 @@ namespace k8s /// the custom resource's version /// /// - /// the custom object's plural name. For TPRs this would be lowercase + /// the custom resource's plural name. For TPRs this would be lowercase /// plural kind. /// /// /// the custom object's name /// - /// - /// The duration in seconds before the object should be deleted. Value - /// must be non-negative integer. The value zero indicates delete - /// immediately. If this value is nil, the default grace period for the - /// specified type will be used. Defaults to a per object value if not - /// specified. zero means delete immediately. - /// - /// - /// Deprecated: please use the PropagationPolicy, this field will be - /// deprecated in 1.7. Should the dependent objects be orphaned. If - /// true/false, the "orphan" finalizer will be added to/removed from - /// the object's finalizers list. Either this field or - /// PropagationPolicy may be set, but not both. - /// - /// - /// Whether and how garbage collection will be performed. Either this - /// field or OrphanDependents may be set, but not both. The default - /// policy is decided by the existing finalizer set in the - /// metadata.finalizers and the resource-specific default policy. - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> DeleteClusterCustomObjectWithHttpMessagesAsync(V1DeleteOptions body, string group, string version, string plural, string name, int? gracePeriodSeconds = default(int?), bool? orphanDependents = default(bool?), string propagationPolicy = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ReplaceClusterCustomObjectStatusWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Returns a cluster scoped custom object + /// partially update status of the specified cluster scoped custom + /// object + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase + /// plural kind. + /// + /// + /// the custom object's name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> PatchClusterCustomObjectStatusWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// read status of the specified cluster scoped custom object /// /// /// the custom resource's group @@ -29373,7 +29326,7 @@ namespace k8s /// the custom resource's version /// /// - /// the custom object's plural name. For TPRs this would be lowercase + /// the custom resource's plural name. For TPRs this would be lowercase /// plural kind. /// /// @@ -29385,7 +29338,7 @@ namespace k8s /// /// The cancellation token. /// - Task> GetClusterCustomObjectWithHttpMessagesAsync(string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetClusterCustomObjectStatusWithHttpMessagesAsync(string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// replace the specified namespace scoped custom object @@ -29523,5 +29476,378 @@ namespace k8s /// Task> GetNamespacedCustomObjectWithHttpMessagesAsync(string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// replace scale of the specified namespace scoped custom object + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase + /// plural kind. + /// + /// + /// the custom object's name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> ReplaceNamespacedCustomObjectScaleWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// partially update scale of the specified namespace scoped custom + /// object + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase + /// plural kind. + /// + /// + /// the custom object's name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> PatchNamespacedCustomObjectScaleWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// read scale of the specified namespace scoped custom object + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase + /// plural kind. + /// + /// + /// the custom object's name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> GetNamespacedCustomObjectScaleWithHttpMessagesAsync(string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// replace scale of the specified cluster scoped custom object + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase + /// plural kind. + /// + /// + /// the custom object's name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> ReplaceClusterCustomObjectScaleWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// partially update scale of the specified cluster scoped custom + /// object + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase + /// plural kind. + /// + /// + /// the custom object's name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> PatchClusterCustomObjectScaleWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// read scale of the specified custom object + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase + /// plural kind. + /// + /// + /// the custom object's name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> GetClusterCustomObjectScaleWithHttpMessagesAsync(string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// replace the specified cluster scoped custom object + /// + /// + /// The JSON schema of the Resource to replace. + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom object's plural name. For TPRs this would be lowercase + /// plural kind. + /// + /// + /// the custom object's name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> ReplaceClusterCustomObjectWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// patch the specified cluster scoped custom object + /// + /// + /// The JSON schema of the Resource to patch. + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom object's plural name. For TPRs this would be lowercase + /// plural kind. + /// + /// + /// the custom object's name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> PatchClusterCustomObjectWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Deletes the specified cluster scoped custom object + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom object's plural name. For TPRs this would be lowercase + /// plural kind. + /// + /// + /// the custom object's name + /// + /// + /// The duration in seconds before the object should be deleted. Value + /// must be non-negative integer. The value zero indicates delete + /// immediately. If this value is nil, the default grace period for the + /// specified type will be used. Defaults to a per object value if not + /// specified. zero means delete immediately. + /// + /// + /// Deprecated: please use the PropagationPolicy, this field will be + /// deprecated in 1.7. Should the dependent objects be orphaned. If + /// true/false, the "orphan" finalizer will be added to/removed from + /// the object's finalizers list. Either this field or + /// PropagationPolicy may be set, but not both. + /// + /// + /// Whether and how garbage collection will be performed. Either this + /// field or OrphanDependents may be set, but not both. The default + /// policy is decided by the existing finalizer set in the + /// metadata.finalizers and the resource-specific default policy. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> DeleteClusterCustomObjectWithHttpMessagesAsync(V1DeleteOptions body, string group, string version, string plural, string name, int? gracePeriodSeconds = default(int?), bool? orphanDependents = default(bool?), string propagationPolicy = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Returns a cluster scoped custom object + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom object's plural name. For TPRs this would be lowercase + /// plural kind. + /// + /// + /// the custom object's name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> GetClusterCustomObjectWithHttpMessagesAsync(string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// replace status of the specified namespace scoped custom object + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase + /// plural kind. + /// + /// + /// the custom object's name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> ReplaceNamespacedCustomObjectStatusWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// partially update status of the specified namespace scoped custom + /// object + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase + /// plural kind. + /// + /// + /// the custom object's name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> PatchNamespacedCustomObjectStatusWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// read status of the specified namespace scoped custom object + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase + /// plural kind. + /// + /// + /// the custom object's name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> GetNamespacedCustomObjectStatusWithHttpMessagesAsync(string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } } diff --git a/src/KubernetesClient/generated/Kubernetes.cs b/src/KubernetesClient/generated/Kubernetes.cs index 93465e6..a46b987 100644 --- a/src/KubernetesClient/generated/Kubernetes.cs +++ b/src/KubernetesClient/generated/Kubernetes.cs @@ -152841,397 +152841,6 @@ namespace k8s return _result; } - /// - /// Creates a cluster scoped Custom object - /// - /// - /// The JSON schema of the Resource to create. - /// - /// - /// The custom resource's group name - /// - /// - /// The custom resource's version - /// - /// - /// The custom resource's plural name. For TPRs this would be lowercase plural - /// kind. - /// - /// - /// If 'true', then the output is pretty printed. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> CreateClusterCustomObjectWithHttpMessagesAsync(object body, string group, string version, string plural, string pretty = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (body == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); - } - if (group == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "group"); - } - if (version == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "version"); - } - if (plural == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "plural"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); - tracingParameters.Add("pretty", pretty); - tracingParameters.Add("group", group); - tracingParameters.Add("version", version); - tracingParameters.Add("plural", plural); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateClusterCustomObject", tracingParameters); - } - // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}").ToString(); - _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); - _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); - _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); - List _queryParameters = new List(); - if (pretty != null) - { - _queryParameters.Add(string.Format("pretty={0}", System.Uri.EscapeDataString(pretty))); - } - if (_queryParameters.Count > 0) - { - _url += "?" + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(body != null) - { - _requestContent = SafeJsonConvert.SerializeObject(body, SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 401) - { - var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - } - else { - _responseContent = string.Empty; - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new HttpOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// list or watch cluster scoped custom objects - /// - /// - /// The custom resource's group name - /// - /// - /// The custom resource's version - /// - /// - /// The custom resource's plural name. For TPRs this would be lowercase plural - /// kind. - /// - /// - /// A selector to restrict the list of returned objects by their labels. - /// Defaults to everything. - /// - /// - /// When specified with a watch call, shows changes that occur after that - /// particular version of a resource. Defaults to changes from the beginning of - /// history. When specified for list: - if unset, then the result is returned - /// from remote storage based on quorum-read flag; - if it's 0, then we simply - /// return what we currently have in cache, no guarantee; - if set to non zero, - /// then the result is at least as fresh as given rv. - /// - /// - /// Watch for changes to the described resources and return them as a stream of - /// add, update, and remove notifications. - /// - /// - /// If 'true', then the output is pretty printed. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> ListClusterCustomObjectWithHttpMessagesAsync(string group, string version, string plural, string labelSelector = default(string), string resourceVersion = default(string), bool? watch = default(bool?), string pretty = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (group == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "group"); - } - if (version == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "version"); - } - if (plural == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "plural"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("labelSelector", labelSelector); - tracingParameters.Add("resourceVersion", resourceVersion); - tracingParameters.Add("watch", watch); - tracingParameters.Add("pretty", pretty); - tracingParameters.Add("group", group); - tracingParameters.Add("version", version); - tracingParameters.Add("plural", plural); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListClusterCustomObject", tracingParameters); - } - // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}").ToString(); - _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); - _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); - _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); - List _queryParameters = new List(); - if (labelSelector != null) - { - _queryParameters.Add(string.Format("labelSelector={0}", System.Uri.EscapeDataString(labelSelector))); - } - if (resourceVersion != null) - { - _queryParameters.Add(string.Format("resourceVersion={0}", System.Uri.EscapeDataString(resourceVersion))); - } - if (watch != null) - { - _queryParameters.Add(string.Format("watch={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(watch, SerializationSettings).Trim('"')))); - } - if (pretty != null) - { - _queryParameters.Add(string.Format("pretty={0}", System.Uri.EscapeDataString(pretty))); - } - if (_queryParameters.Count > 0) - { - _url += "?" + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 401) - { - var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - } - else { - _responseContent = string.Empty; - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new HttpOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - /// /// Creates a namespace scoped Custom object /// @@ -153642,23 +153251,23 @@ namespace k8s } /// - /// replace the specified cluster scoped custom object + /// Creates a cluster scoped Custom object /// /// - /// The JSON schema of the Resource to replace. + /// The JSON schema of the Resource to create. /// /// - /// the custom resource's group + /// The custom resource's group name /// /// - /// the custom resource's version + /// The custom resource's version /// /// - /// the custom object's plural name. For TPRs this would be lowercase plural + /// The custom resource's plural name. For TPRs this would be lowercase plural /// kind. /// - /// - /// the custom object's name + /// + /// If 'true', then the output is pretty printed. /// /// /// Headers that will be added to request. @@ -153681,7 +153290,7 @@ namespace k8s /// /// A response object containing the response body and response headers. /// - public async Task> ReplaceClusterCustomObjectWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateClusterCustomObjectWithHttpMessagesAsync(object body, string group, string version, string plural, string pretty = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (body == null) { @@ -153699,10 +153308,6 @@ namespace k8s { throw new ValidationException(ValidationRules.CannotBeNull, "plural"); } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -153711,24 +153316,32 @@ namespace k8s _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("body", body); + tracingParameters.Add("pretty", pretty); tracingParameters.Add("group", group); tracingParameters.Add("version", version); tracingParameters.Add("plural", plural); - tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ReplaceClusterCustomObject", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateClusterCustomObject", tracingParameters); } // Construct URL var _baseUrl = BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}/{name}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}").ToString(); _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + List _queryParameters = new List(); + if (pretty != null) + { + _queryParameters.Add(string.Format("pretty={0}", System.Uri.EscapeDataString(pretty))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers @@ -153773,6 +153386,210 @@ namespace k8s HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 201 && (int)_statusCode != 401) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// list or watch cluster scoped custom objects + /// + /// + /// The custom resource's group name + /// + /// + /// The custom resource's version + /// + /// + /// The custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// A selector to restrict the list of returned objects by their labels. + /// Defaults to everything. + /// + /// + /// When specified with a watch call, shows changes that occur after that + /// particular version of a resource. Defaults to changes from the beginning of + /// history. When specified for list: - if unset, then the result is returned + /// from remote storage based on quorum-read flag; - if it's 0, then we simply + /// return what we currently have in cache, no guarantee; - if set to non zero, + /// then the result is at least as fresh as given rv. + /// + /// + /// Watch for changes to the described resources and return them as a stream of + /// add, update, and remove notifications. + /// + /// + /// If 'true', then the output is pretty printed. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListClusterCustomObjectWithHttpMessagesAsync(string group, string version, string plural, string labelSelector = default(string), string resourceVersion = default(string), bool? watch = default(bool?), string pretty = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (group == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "group"); + } + if (version == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "version"); + } + if (plural == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "plural"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("labelSelector", labelSelector); + tracingParameters.Add("resourceVersion", resourceVersion); + tracingParameters.Add("watch", watch); + tracingParameters.Add("pretty", pretty); + tracingParameters.Add("group", group); + tracingParameters.Add("version", version); + tracingParameters.Add("plural", plural); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListClusterCustomObject", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}").ToString(); + _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); + _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); + _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); + List _queryParameters = new List(); + if (labelSelector != null) + { + _queryParameters.Add(string.Format("labelSelector={0}", System.Uri.EscapeDataString(labelSelector))); + } + if (resourceVersion != null) + { + _queryParameters.Add(string.Format("resourceVersion={0}", System.Uri.EscapeDataString(resourceVersion))); + } + if (watch != null) + { + _queryParameters.Add(string.Format("watch={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(watch, SerializationSettings).Trim('"')))); + } + if (pretty != null) + { + _queryParameters.Add(string.Format("pretty={0}", System.Uri.EscapeDataString(pretty))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 401) { var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -153825,10 +153642,9 @@ namespace k8s } /// - /// patch the specified cluster scoped custom object + /// replace status of the cluster scoped specified custom object /// /// - /// The JSON schema of the Resource to patch. /// /// /// the custom resource's group @@ -153837,7 +153653,7 @@ namespace k8s /// the custom resource's version /// /// - /// the custom object's plural name. For TPRs this would be lowercase plural + /// the custom resource's plural name. For TPRs this would be lowercase plural /// kind. /// /// @@ -153864,7 +153680,7 @@ namespace k8s /// /// A response object containing the response body and response headers. /// - public async Task> PatchClusterCustomObjectWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ReplaceClusterCustomObjectStatusWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (body == null) { @@ -153899,11 +153715,211 @@ namespace k8s tracingParameters.Add("plural", plural); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "PatchClusterCustomObject", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ReplaceClusterCustomObjectStatus", tracingParameters); } // Construct URL var _baseUrl = BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}/{name}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}/{name}/status").ToString(); + _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); + _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); + _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = SafeJsonConvert.SerializeObject(body, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 401) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// partially update status of the specified cluster scoped custom object + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PatchClusterCustomObjectStatusWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + if (group == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "group"); + } + if (version == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "version"); + } + if (plural == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "plural"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("body", body); + tracingParameters.Add("group", group); + tracingParameters.Add("version", version); + tracingParameters.Add("plural", plural); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "PatchClusterCustomObjectStatus", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}/{name}/status").ToString(); _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); @@ -154008,228 +154024,7 @@ namespace k8s } /// - /// Deletes the specified cluster scoped custom object - /// - /// - /// - /// - /// the custom resource's group - /// - /// - /// the custom resource's version - /// - /// - /// the custom object's plural name. For TPRs this would be lowercase plural - /// kind. - /// - /// - /// the custom object's name - /// - /// - /// The duration in seconds before the object should be deleted. Value must be - /// non-negative integer. The value zero indicates delete immediately. If this - /// value is nil, the default grace period for the specified type will be used. - /// Defaults to a per object value if not specified. zero means delete - /// immediately. - /// - /// - /// Deprecated: please use the PropagationPolicy, this field will be deprecated - /// in 1.7. Should the dependent objects be orphaned. If true/false, the - /// "orphan" finalizer will be added to/removed from the object's finalizers - /// list. Either this field or PropagationPolicy may be set, but not both. - /// - /// - /// Whether and how garbage collection will be performed. Either this field or - /// OrphanDependents may be set, but not both. The default policy is decided by - /// the existing finalizer set in the metadata.finalizers and the - /// resource-specific default policy. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> DeleteClusterCustomObjectWithHttpMessagesAsync(V1DeleteOptions body, string group, string version, string plural, string name, int? gracePeriodSeconds = default(int?), bool? orphanDependents = default(bool?), string propagationPolicy = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (body == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); - } - if (group == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "group"); - } - if (version == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "version"); - } - if (plural == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "plural"); - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); - tracingParameters.Add("gracePeriodSeconds", gracePeriodSeconds); - tracingParameters.Add("orphanDependents", orphanDependents); - tracingParameters.Add("propagationPolicy", propagationPolicy); - tracingParameters.Add("group", group); - tracingParameters.Add("version", version); - tracingParameters.Add("plural", plural); - tracingParameters.Add("name", name); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteClusterCustomObject", tracingParameters); - } - // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}/{name}").ToString(); - _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); - _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); - _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - List _queryParameters = new List(); - if (gracePeriodSeconds != null) - { - _queryParameters.Add(string.Format("gracePeriodSeconds={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(gracePeriodSeconds, SerializationSettings).Trim('"')))); - } - if (orphanDependents != null) - { - _queryParameters.Add(string.Format("orphanDependents={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(orphanDependents, SerializationSettings).Trim('"')))); - } - if (propagationPolicy != null) - { - _queryParameters.Add(string.Format("propagationPolicy={0}", System.Uri.EscapeDataString(propagationPolicy))); - } - if (_queryParameters.Count > 0) - { - _url += "?" + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(body != null) - { - _requestContent = SafeJsonConvert.SerializeObject(body, SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 401) - { - var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - } - else { - _responseContent = string.Empty; - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new HttpOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Returns a cluster scoped custom object + /// read status of the specified cluster scoped custom object /// /// /// the custom resource's group @@ -154238,7 +154033,7 @@ namespace k8s /// the custom resource's version /// /// - /// the custom object's plural name. For TPRs this would be lowercase plural + /// the custom resource's plural name. For TPRs this would be lowercase plural /// kind. /// /// @@ -154265,7 +154060,7 @@ namespace k8s /// /// A response object containing the response body and response headers. /// - public async Task> GetClusterCustomObjectWithHttpMessagesAsync(string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetClusterCustomObjectStatusWithHttpMessagesAsync(string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (group == null) { @@ -154295,11 +154090,11 @@ namespace k8s tracingParameters.Add("plural", plural); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetClusterCustomObject", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetClusterCustomObjectStatus", tracingParameters); } // Construct URL var _baseUrl = BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}/{name}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}/{name}/status").ToString(); _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); @@ -155104,6 +154899,2469 @@ namespace k8s // Set Headers + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 401) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// replace scale of the specified namespace scoped custom object + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ReplaceNamespacedCustomObjectScaleWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + if (group == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "group"); + } + if (version == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "version"); + } + if (namespaceParameter == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceParameter"); + } + if (plural == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "plural"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("body", body); + tracingParameters.Add("group", group); + tracingParameters.Add("version", version); + tracingParameters.Add("namespaceParameter", namespaceParameter); + tracingParameters.Add("plural", plural); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ReplaceNamespacedCustomObjectScale", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale").ToString(); + _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); + _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); + _url = _url.Replace("{namespace}", System.Uri.EscapeDataString(namespaceParameter)); + _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = SafeJsonConvert.SerializeObject(body, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 401) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// partially update scale of the specified namespace scoped custom object + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PatchNamespacedCustomObjectScaleWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + if (group == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "group"); + } + if (version == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "version"); + } + if (namespaceParameter == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceParameter"); + } + if (plural == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "plural"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("body", body); + tracingParameters.Add("group", group); + tracingParameters.Add("version", version); + tracingParameters.Add("namespaceParameter", namespaceParameter); + tracingParameters.Add("plural", plural); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "PatchNamespacedCustomObjectScale", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale").ToString(); + _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); + _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); + _url = _url.Replace("{namespace}", System.Uri.EscapeDataString(namespaceParameter)); + _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = SafeJsonConvert.SerializeObject(body, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/merge-patch+json"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 401) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// read scale of the specified namespace scoped custom object + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetNamespacedCustomObjectScaleWithHttpMessagesAsync(string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (group == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "group"); + } + if (version == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "version"); + } + if (namespaceParameter == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceParameter"); + } + if (plural == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "plural"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("group", group); + tracingParameters.Add("version", version); + tracingParameters.Add("namespaceParameter", namespaceParameter); + tracingParameters.Add("plural", plural); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetNamespacedCustomObjectScale", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale").ToString(); + _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); + _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); + _url = _url.Replace("{namespace}", System.Uri.EscapeDataString(namespaceParameter)); + _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 401) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// replace scale of the specified cluster scoped custom object + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ReplaceClusterCustomObjectScaleWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + if (group == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "group"); + } + if (version == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "version"); + } + if (plural == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "plural"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("body", body); + tracingParameters.Add("group", group); + tracingParameters.Add("version", version); + tracingParameters.Add("plural", plural); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ReplaceClusterCustomObjectScale", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}/{name}/scale").ToString(); + _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); + _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); + _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = SafeJsonConvert.SerializeObject(body, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 401) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// partially update scale of the specified cluster scoped custom object + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PatchClusterCustomObjectScaleWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + if (group == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "group"); + } + if (version == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "version"); + } + if (plural == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "plural"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("body", body); + tracingParameters.Add("group", group); + tracingParameters.Add("version", version); + tracingParameters.Add("plural", plural); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "PatchClusterCustomObjectScale", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}/{name}/scale").ToString(); + _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); + _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); + _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = SafeJsonConvert.SerializeObject(body, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/merge-patch+json"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 401) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// read scale of the specified custom object + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetClusterCustomObjectScaleWithHttpMessagesAsync(string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (group == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "group"); + } + if (version == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "version"); + } + if (plural == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "plural"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("group", group); + tracingParameters.Add("version", version); + tracingParameters.Add("plural", plural); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetClusterCustomObjectScale", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}/{name}/scale").ToString(); + _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); + _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); + _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 401) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// replace the specified cluster scoped custom object + /// + /// + /// The JSON schema of the Resource to replace. + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom object's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ReplaceClusterCustomObjectWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + if (group == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "group"); + } + if (version == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "version"); + } + if (plural == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "plural"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("body", body); + tracingParameters.Add("group", group); + tracingParameters.Add("version", version); + tracingParameters.Add("plural", plural); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ReplaceClusterCustomObject", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}/{name}").ToString(); + _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); + _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); + _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = SafeJsonConvert.SerializeObject(body, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 401) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// patch the specified cluster scoped custom object + /// + /// + /// The JSON schema of the Resource to patch. + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom object's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PatchClusterCustomObjectWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + if (group == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "group"); + } + if (version == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "version"); + } + if (plural == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "plural"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("body", body); + tracingParameters.Add("group", group); + tracingParameters.Add("version", version); + tracingParameters.Add("plural", plural); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "PatchClusterCustomObject", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}/{name}").ToString(); + _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); + _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); + _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = SafeJsonConvert.SerializeObject(body, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/merge-patch+json"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 401) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the specified cluster scoped custom object + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom object's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// The duration in seconds before the object should be deleted. Value must be + /// non-negative integer. The value zero indicates delete immediately. If this + /// value is nil, the default grace period for the specified type will be used. + /// Defaults to a per object value if not specified. zero means delete + /// immediately. + /// + /// + /// Deprecated: please use the PropagationPolicy, this field will be deprecated + /// in 1.7. Should the dependent objects be orphaned. If true/false, the + /// "orphan" finalizer will be added to/removed from the object's finalizers + /// list. Either this field or PropagationPolicy may be set, but not both. + /// + /// + /// Whether and how garbage collection will be performed. Either this field or + /// OrphanDependents may be set, but not both. The default policy is decided by + /// the existing finalizer set in the metadata.finalizers and the + /// resource-specific default policy. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> DeleteClusterCustomObjectWithHttpMessagesAsync(V1DeleteOptions body, string group, string version, string plural, string name, int? gracePeriodSeconds = default(int?), bool? orphanDependents = default(bool?), string propagationPolicy = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + if (group == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "group"); + } + if (version == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "version"); + } + if (plural == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "plural"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("body", body); + tracingParameters.Add("gracePeriodSeconds", gracePeriodSeconds); + tracingParameters.Add("orphanDependents", orphanDependents); + tracingParameters.Add("propagationPolicy", propagationPolicy); + tracingParameters.Add("group", group); + tracingParameters.Add("version", version); + tracingParameters.Add("plural", plural); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "DeleteClusterCustomObject", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}/{name}").ToString(); + _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); + _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); + _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + List _queryParameters = new List(); + if (gracePeriodSeconds != null) + { + _queryParameters.Add(string.Format("gracePeriodSeconds={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(gracePeriodSeconds, SerializationSettings).Trim('"')))); + } + if (orphanDependents != null) + { + _queryParameters.Add(string.Format("orphanDependents={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(orphanDependents, SerializationSettings).Trim('"')))); + } + if (propagationPolicy != null) + { + _queryParameters.Add(string.Format("propagationPolicy={0}", System.Uri.EscapeDataString(propagationPolicy))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = SafeJsonConvert.SerializeObject(body, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 401) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns a cluster scoped custom object + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom object's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetClusterCustomObjectWithHttpMessagesAsync(string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (group == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "group"); + } + if (version == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "version"); + } + if (plural == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "plural"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("group", group); + tracingParameters.Add("version", version); + tracingParameters.Add("plural", plural); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetClusterCustomObject", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}/{name}").ToString(); + _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); + _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); + _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 401) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// replace status of the specified namespace scoped custom object + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ReplaceNamespacedCustomObjectStatusWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + if (group == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "group"); + } + if (version == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "version"); + } + if (namespaceParameter == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceParameter"); + } + if (plural == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "plural"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("body", body); + tracingParameters.Add("group", group); + tracingParameters.Add("version", version); + tracingParameters.Add("namespaceParameter", namespaceParameter); + tracingParameters.Add("plural", plural); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ReplaceNamespacedCustomObjectStatus", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status").ToString(); + _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); + _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); + _url = _url.Replace("{namespace}", System.Uri.EscapeDataString(namespaceParameter)); + _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = SafeJsonConvert.SerializeObject(body, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 401) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// partially update status of the specified namespace scoped custom object + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PatchNamespacedCustomObjectStatusWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + if (group == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "group"); + } + if (version == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "version"); + } + if (namespaceParameter == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceParameter"); + } + if (plural == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "plural"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("body", body); + tracingParameters.Add("group", group); + tracingParameters.Add("version", version); + tracingParameters.Add("namespaceParameter", namespaceParameter); + tracingParameters.Add("plural", plural); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "PatchNamespacedCustomObjectStatus", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status").ToString(); + _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); + _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); + _url = _url.Replace("{namespace}", System.Uri.EscapeDataString(namespaceParameter)); + _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = SafeJsonConvert.SerializeObject(body, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/merge-patch+json"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 401) + { + var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// read status of the specified namespace scoped custom object + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetNamespacedCustomObjectStatusWithHttpMessagesAsync(string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (group == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "group"); + } + if (version == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "version"); + } + if (namespaceParameter == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceParameter"); + } + if (plural == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "plural"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("group", group); + tracingParameters.Add("version", version); + tracingParameters.Add("namespaceParameter", namespaceParameter); + tracingParameters.Add("plural", plural); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetNamespacedCustomObjectStatus", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status").ToString(); + _url = _url.Replace("{group}", System.Uri.EscapeDataString(group)); + _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); + _url = _url.Replace("{namespace}", System.Uri.EscapeDataString(namespaceParameter)); + _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + + if (customHeaders != null) { foreach(var _header in customHeaders) diff --git a/src/KubernetesClient/generated/KubernetesExtensions.cs b/src/KubernetesClient/generated/KubernetesExtensions.cs index def7492..233bb9c 100644 --- a/src/KubernetesClient/generated/KubernetesExtensions.cs +++ b/src/KubernetesClient/generated/KubernetesExtensions.cs @@ -60345,152 +60345,6 @@ namespace k8s } } - /// - /// Creates a cluster scoped Custom object - /// - /// - /// The operations group for this extension method. - /// - /// - /// The JSON schema of the Resource to create. - /// - /// - /// The custom resource's group name - /// - /// - /// The custom resource's version - /// - /// - /// The custom resource's plural name. For TPRs this would be lowercase plural - /// kind. - /// - /// - /// If 'true', then the output is pretty printed. - /// - public static object CreateClusterCustomObject(this IKubernetes operations, object body, string group, string version, string plural, string pretty = default(string)) - { - return operations.CreateClusterCustomObjectAsync(body, group, version, plural, pretty).GetAwaiter().GetResult(); - } - - /// - /// Creates a cluster scoped Custom object - /// - /// - /// The operations group for this extension method. - /// - /// - /// The JSON schema of the Resource to create. - /// - /// - /// The custom resource's group name - /// - /// - /// The custom resource's version - /// - /// - /// The custom resource's plural name. For TPRs this would be lowercase plural - /// kind. - /// - /// - /// If 'true', then the output is pretty printed. - /// - /// - /// The cancellation token. - /// - public static async Task CreateClusterCustomObjectAsync(this IKubernetes operations, object body, string group, string version, string plural, string pretty = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateClusterCustomObjectWithHttpMessagesAsync(body, group, version, plural, pretty, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// list or watch cluster scoped custom objects - /// - /// - /// The operations group for this extension method. - /// - /// - /// The custom resource's group name - /// - /// - /// The custom resource's version - /// - /// - /// The custom resource's plural name. For TPRs this would be lowercase plural - /// kind. - /// - /// - /// A selector to restrict the list of returned objects by their labels. - /// Defaults to everything. - /// - /// - /// When specified with a watch call, shows changes that occur after that - /// particular version of a resource. Defaults to changes from the beginning of - /// history. When specified for list: - if unset, then the result is returned - /// from remote storage based on quorum-read flag; - if it's 0, then we simply - /// return what we currently have in cache, no guarantee; - if set to non zero, - /// then the result is at least as fresh as given rv. - /// - /// - /// Watch for changes to the described resources and return them as a stream of - /// add, update, and remove notifications. - /// - /// - /// If 'true', then the output is pretty printed. - /// - public static object ListClusterCustomObject(this IKubernetes operations, string group, string version, string plural, string labelSelector = default(string), string resourceVersion = default(string), bool? watch = default(bool?), string pretty = default(string)) - { - return operations.ListClusterCustomObjectAsync(group, version, plural, labelSelector, resourceVersion, watch, pretty).GetAwaiter().GetResult(); - } - - /// - /// list or watch cluster scoped custom objects - /// - /// - /// The operations group for this extension method. - /// - /// - /// The custom resource's group name - /// - /// - /// The custom resource's version - /// - /// - /// The custom resource's plural name. For TPRs this would be lowercase plural - /// kind. - /// - /// - /// A selector to restrict the list of returned objects by their labels. - /// Defaults to everything. - /// - /// - /// When specified with a watch call, shows changes that occur after that - /// particular version of a resource. Defaults to changes from the beginning of - /// history. When specified for list: - if unset, then the result is returned - /// from remote storage based on quorum-read flag; - if it's 0, then we simply - /// return what we currently have in cache, no guarantee; - if set to non zero, - /// then the result is at least as fresh as given rv. - /// - /// - /// Watch for changes to the described resources and return them as a stream of - /// add, update, and remove notifications. - /// - /// - /// If 'true', then the output is pretty printed. - /// - /// - /// The cancellation token. - /// - public static async Task ListClusterCustomObjectAsync(this IKubernetes operations, string group, string version, string plural, string labelSelector = default(string), string resourceVersion = default(string), bool? watch = default(bool?), string pretty = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListClusterCustomObjectWithHttpMessagesAsync(group, version, plural, labelSelector, resourceVersion, watch, pretty, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Creates a namespace scoped Custom object /// @@ -60650,127 +60504,153 @@ namespace k8s } /// - /// replace the specified cluster scoped custom object + /// Creates a cluster scoped Custom object /// /// /// The operations group for this extension method. /// /// - /// The JSON schema of the Resource to replace. + /// The JSON schema of the Resource to create. /// /// - /// the custom resource's group + /// The custom resource's group name /// /// - /// the custom resource's version + /// The custom resource's version /// /// - /// the custom object's plural name. For TPRs this would be lowercase plural + /// The custom resource's plural name. For TPRs this would be lowercase plural /// kind. /// - /// - /// the custom object's name + /// + /// If 'true', then the output is pretty printed. /// - public static object ReplaceClusterCustomObject(this IKubernetes operations, object body, string group, string version, string plural, string name) + public static object CreateClusterCustomObject(this IKubernetes operations, object body, string group, string version, string plural, string pretty = default(string)) { - return operations.ReplaceClusterCustomObjectAsync(body, group, version, plural, name).GetAwaiter().GetResult(); + return operations.CreateClusterCustomObjectAsync(body, group, version, plural, pretty).GetAwaiter().GetResult(); } /// - /// replace the specified cluster scoped custom object + /// Creates a cluster scoped Custom object /// /// /// The operations group for this extension method. /// /// - /// The JSON schema of the Resource to replace. + /// The JSON schema of the Resource to create. /// /// - /// the custom resource's group + /// The custom resource's group name /// /// - /// the custom resource's version + /// The custom resource's version /// /// - /// the custom object's plural name. For TPRs this would be lowercase plural + /// The custom resource's plural name. For TPRs this would be lowercase plural /// kind. /// - /// - /// the custom object's name + /// + /// If 'true', then the output is pretty printed. /// /// /// The cancellation token. /// - public static async Task ReplaceClusterCustomObjectAsync(this IKubernetes operations, object body, string group, string version, string plural, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateClusterCustomObjectAsync(this IKubernetes operations, object body, string group, string version, string plural, string pretty = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ReplaceClusterCustomObjectWithHttpMessagesAsync(body, group, version, plural, name, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateClusterCustomObjectWithHttpMessagesAsync(body, group, version, plural, pretty, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// patch the specified cluster scoped custom object + /// list or watch cluster scoped custom objects /// /// /// The operations group for this extension method. /// - /// - /// The JSON schema of the Resource to patch. - /// /// - /// the custom resource's group + /// The custom resource's group name /// /// - /// the custom resource's version + /// The custom resource's version /// /// - /// the custom object's plural name. For TPRs this would be lowercase plural + /// The custom resource's plural name. For TPRs this would be lowercase plural /// kind. /// - /// - /// the custom object's name + /// + /// A selector to restrict the list of returned objects by their labels. + /// Defaults to everything. /// - public static object PatchClusterCustomObject(this IKubernetes operations, object body, string group, string version, string plural, string name) + /// + /// When specified with a watch call, shows changes that occur after that + /// particular version of a resource. Defaults to changes from the beginning of + /// history. When specified for list: - if unset, then the result is returned + /// from remote storage based on quorum-read flag; - if it's 0, then we simply + /// return what we currently have in cache, no guarantee; - if set to non zero, + /// then the result is at least as fresh as given rv. + /// + /// + /// Watch for changes to the described resources and return them as a stream of + /// add, update, and remove notifications. + /// + /// + /// If 'true', then the output is pretty printed. + /// + public static object ListClusterCustomObject(this IKubernetes operations, string group, string version, string plural, string labelSelector = default(string), string resourceVersion = default(string), bool? watch = default(bool?), string pretty = default(string)) { - return operations.PatchClusterCustomObjectAsync(body, group, version, plural, name).GetAwaiter().GetResult(); + return operations.ListClusterCustomObjectAsync(group, version, plural, labelSelector, resourceVersion, watch, pretty).GetAwaiter().GetResult(); } /// - /// patch the specified cluster scoped custom object + /// list or watch cluster scoped custom objects /// /// /// The operations group for this extension method. /// - /// - /// The JSON schema of the Resource to patch. - /// /// - /// the custom resource's group + /// The custom resource's group name /// /// - /// the custom resource's version + /// The custom resource's version /// /// - /// the custom object's plural name. For TPRs this would be lowercase plural + /// The custom resource's plural name. For TPRs this would be lowercase plural /// kind. /// - /// - /// the custom object's name + /// + /// A selector to restrict the list of returned objects by their labels. + /// Defaults to everything. + /// + /// + /// When specified with a watch call, shows changes that occur after that + /// particular version of a resource. Defaults to changes from the beginning of + /// history. When specified for list: - if unset, then the result is returned + /// from remote storage based on quorum-read flag; - if it's 0, then we simply + /// return what we currently have in cache, no guarantee; - if set to non zero, + /// then the result is at least as fresh as given rv. + /// + /// + /// Watch for changes to the described resources and return them as a stream of + /// add, update, and remove notifications. + /// + /// + /// If 'true', then the output is pretty printed. /// /// /// The cancellation token. /// - public static async Task PatchClusterCustomObjectAsync(this IKubernetes operations, object body, string group, string version, string plural, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListClusterCustomObjectAsync(this IKubernetes operations, string group, string version, string plural, string labelSelector = default(string), string resourceVersion = default(string), bool? watch = default(bool?), string pretty = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.PatchClusterCustomObjectWithHttpMessagesAsync(body, group, version, plural, name, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListClusterCustomObjectWithHttpMessagesAsync(group, version, plural, labelSelector, resourceVersion, watch, pretty, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes the specified cluster scoped custom object + /// replace status of the cluster scoped specified custom object /// /// /// The operations group for this extension method. @@ -60784,38 +60664,19 @@ namespace k8s /// the custom resource's version /// /// - /// the custom object's plural name. For TPRs this would be lowercase plural + /// the custom resource's plural name. For TPRs this would be lowercase plural /// kind. /// /// /// the custom object's name /// - /// - /// The duration in seconds before the object should be deleted. Value must be - /// non-negative integer. The value zero indicates delete immediately. If this - /// value is nil, the default grace period for the specified type will be used. - /// Defaults to a per object value if not specified. zero means delete - /// immediately. - /// - /// - /// Deprecated: please use the PropagationPolicy, this field will be deprecated - /// in 1.7. Should the dependent objects be orphaned. If true/false, the - /// "orphan" finalizer will be added to/removed from the object's finalizers - /// list. Either this field or PropagationPolicy may be set, but not both. - /// - /// - /// Whether and how garbage collection will be performed. Either this field or - /// OrphanDependents may be set, but not both. The default policy is decided by - /// the existing finalizer set in the metadata.finalizers and the - /// resource-specific default policy. - /// - public static object DeleteClusterCustomObject(this IKubernetes operations, V1DeleteOptions body, string group, string version, string plural, string name, int? gracePeriodSeconds = default(int?), bool? orphanDependents = default(bool?), string propagationPolicy = default(string)) + public static object ReplaceClusterCustomObjectStatus(this IKubernetes operations, object body, string group, string version, string plural, string name) { - return operations.DeleteClusterCustomObjectAsync(body, group, version, plural, name, gracePeriodSeconds, orphanDependents, propagationPolicy).GetAwaiter().GetResult(); + return operations.ReplaceClusterCustomObjectStatusAsync(body, group, version, plural, name).GetAwaiter().GetResult(); } /// - /// Deletes the specified cluster scoped custom object + /// replace status of the cluster scoped specified custom object /// /// /// The operations group for this extension method. @@ -60829,48 +60690,31 @@ namespace k8s /// the custom resource's version /// /// - /// the custom object's plural name. For TPRs this would be lowercase plural + /// the custom resource's plural name. For TPRs this would be lowercase plural /// kind. /// /// /// the custom object's name /// - /// - /// The duration in seconds before the object should be deleted. Value must be - /// non-negative integer. The value zero indicates delete immediately. If this - /// value is nil, the default grace period for the specified type will be used. - /// Defaults to a per object value if not specified. zero means delete - /// immediately. - /// - /// - /// Deprecated: please use the PropagationPolicy, this field will be deprecated - /// in 1.7. Should the dependent objects be orphaned. If true/false, the - /// "orphan" finalizer will be added to/removed from the object's finalizers - /// list. Either this field or PropagationPolicy may be set, but not both. - /// - /// - /// Whether and how garbage collection will be performed. Either this field or - /// OrphanDependents may be set, but not both. The default policy is decided by - /// the existing finalizer set in the metadata.finalizers and the - /// resource-specific default policy. - /// /// /// The cancellation token. /// - public static async Task DeleteClusterCustomObjectAsync(this IKubernetes operations, V1DeleteOptions body, string group, string version, string plural, string name, int? gracePeriodSeconds = default(int?), bool? orphanDependents = default(bool?), string propagationPolicy = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ReplaceClusterCustomObjectStatusAsync(this IKubernetes operations, object body, string group, string version, string plural, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DeleteClusterCustomObjectWithHttpMessagesAsync(body, group, version, plural, name, gracePeriodSeconds, orphanDependents, propagationPolicy, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ReplaceClusterCustomObjectStatusWithHttpMessagesAsync(body, group, version, plural, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Returns a cluster scoped custom object + /// partially update status of the specified cluster scoped custom object /// /// /// The operations group for this extension method. /// + /// + /// /// /// the custom resource's group /// @@ -60878,23 +60722,25 @@ namespace k8s /// the custom resource's version /// /// - /// the custom object's plural name. For TPRs this would be lowercase plural + /// the custom resource's plural name. For TPRs this would be lowercase plural /// kind. /// /// /// the custom object's name /// - public static object GetClusterCustomObject(this IKubernetes operations, string group, string version, string plural, string name) + public static object PatchClusterCustomObjectStatus(this IKubernetes operations, object body, string group, string version, string plural, string name) { - return operations.GetClusterCustomObjectAsync(group, version, plural, name).GetAwaiter().GetResult(); + return operations.PatchClusterCustomObjectStatusAsync(body, group, version, plural, name).GetAwaiter().GetResult(); } /// - /// Returns a cluster scoped custom object + /// partially update status of the specified cluster scoped custom object /// /// /// The operations group for this extension method. /// + /// + /// /// /// the custom resource's group /// @@ -60902,7 +60748,7 @@ namespace k8s /// the custom resource's version /// /// - /// the custom object's plural name. For TPRs this would be lowercase plural + /// the custom resource's plural name. For TPRs this would be lowercase plural /// kind. /// /// @@ -60911,9 +60757,63 @@ namespace k8s /// /// The cancellation token. /// - public static async Task GetClusterCustomObjectAsync(this IKubernetes operations, string group, string version, string plural, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task PatchClusterCustomObjectStatusAsync(this IKubernetes operations, object body, string group, string version, string plural, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetClusterCustomObjectWithHttpMessagesAsync(group, version, plural, name, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.PatchClusterCustomObjectStatusWithHttpMessagesAsync(body, group, version, plural, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// read status of the specified cluster scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + public static object GetClusterCustomObjectStatus(this IKubernetes operations, string group, string version, string plural, string name) + { + return operations.GetClusterCustomObjectStatusAsync(group, version, plural, name).GetAwaiter().GetResult(); + } + + /// + /// read status of the specified cluster scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// The cancellation token. + /// + public static async Task GetClusterCustomObjectStatusAsync(this IKubernetes operations, string group, string version, string plural, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetClusterCustomObjectStatusWithHttpMessagesAsync(group, version, plural, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -61213,5 +61113,821 @@ namespace k8s } } + /// + /// replace scale of the specified namespace scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + public static object ReplaceNamespacedCustomObjectScale(this IKubernetes operations, object body, string group, string version, string namespaceParameter, string plural, string name) + { + return operations.ReplaceNamespacedCustomObjectScaleAsync(body, group, version, namespaceParameter, plural, name).GetAwaiter().GetResult(); + } + + /// + /// replace scale of the specified namespace scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// The cancellation token. + /// + public static async Task ReplaceNamespacedCustomObjectScaleAsync(this IKubernetes operations, object body, string group, string version, string namespaceParameter, string plural, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ReplaceNamespacedCustomObjectScaleWithHttpMessagesAsync(body, group, version, namespaceParameter, plural, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// partially update scale of the specified namespace scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + public static object PatchNamespacedCustomObjectScale(this IKubernetes operations, object body, string group, string version, string namespaceParameter, string plural, string name) + { + return operations.PatchNamespacedCustomObjectScaleAsync(body, group, version, namespaceParameter, plural, name).GetAwaiter().GetResult(); + } + + /// + /// partially update scale of the specified namespace scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// The cancellation token. + /// + public static async Task PatchNamespacedCustomObjectScaleAsync(this IKubernetes operations, object body, string group, string version, string namespaceParameter, string plural, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PatchNamespacedCustomObjectScaleWithHttpMessagesAsync(body, group, version, namespaceParameter, plural, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// read scale of the specified namespace scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + public static object GetNamespacedCustomObjectScale(this IKubernetes operations, string group, string version, string namespaceParameter, string plural, string name) + { + return operations.GetNamespacedCustomObjectScaleAsync(group, version, namespaceParameter, plural, name).GetAwaiter().GetResult(); + } + + /// + /// read scale of the specified namespace scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// The cancellation token. + /// + public static async Task GetNamespacedCustomObjectScaleAsync(this IKubernetes operations, string group, string version, string namespaceParameter, string plural, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetNamespacedCustomObjectScaleWithHttpMessagesAsync(group, version, namespaceParameter, plural, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// replace scale of the specified cluster scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + public static object ReplaceClusterCustomObjectScale(this IKubernetes operations, object body, string group, string version, string plural, string name) + { + return operations.ReplaceClusterCustomObjectScaleAsync(body, group, version, plural, name).GetAwaiter().GetResult(); + } + + /// + /// replace scale of the specified cluster scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// The cancellation token. + /// + public static async Task ReplaceClusterCustomObjectScaleAsync(this IKubernetes operations, object body, string group, string version, string plural, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ReplaceClusterCustomObjectScaleWithHttpMessagesAsync(body, group, version, plural, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// partially update scale of the specified cluster scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + public static object PatchClusterCustomObjectScale(this IKubernetes operations, object body, string group, string version, string plural, string name) + { + return operations.PatchClusterCustomObjectScaleAsync(body, group, version, plural, name).GetAwaiter().GetResult(); + } + + /// + /// partially update scale of the specified cluster scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// The cancellation token. + /// + public static async Task PatchClusterCustomObjectScaleAsync(this IKubernetes operations, object body, string group, string version, string plural, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PatchClusterCustomObjectScaleWithHttpMessagesAsync(body, group, version, plural, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// read scale of the specified custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + public static object GetClusterCustomObjectScale(this IKubernetes operations, string group, string version, string plural, string name) + { + return operations.GetClusterCustomObjectScaleAsync(group, version, plural, name).GetAwaiter().GetResult(); + } + + /// + /// read scale of the specified custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// The cancellation token. + /// + public static async Task GetClusterCustomObjectScaleAsync(this IKubernetes operations, string group, string version, string plural, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetClusterCustomObjectScaleWithHttpMessagesAsync(group, version, plural, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// replace the specified cluster scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// The JSON schema of the Resource to replace. + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom object's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + public static object ReplaceClusterCustomObject(this IKubernetes operations, object body, string group, string version, string plural, string name) + { + return operations.ReplaceClusterCustomObjectAsync(body, group, version, plural, name).GetAwaiter().GetResult(); + } + + /// + /// replace the specified cluster scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// The JSON schema of the Resource to replace. + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom object's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// The cancellation token. + /// + public static async Task ReplaceClusterCustomObjectAsync(this IKubernetes operations, object body, string group, string version, string plural, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ReplaceClusterCustomObjectWithHttpMessagesAsync(body, group, version, plural, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// patch the specified cluster scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// The JSON schema of the Resource to patch. + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom object's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + public static object PatchClusterCustomObject(this IKubernetes operations, object body, string group, string version, string plural, string name) + { + return operations.PatchClusterCustomObjectAsync(body, group, version, plural, name).GetAwaiter().GetResult(); + } + + /// + /// patch the specified cluster scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// The JSON schema of the Resource to patch. + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom object's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// The cancellation token. + /// + public static async Task PatchClusterCustomObjectAsync(this IKubernetes operations, object body, string group, string version, string plural, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PatchClusterCustomObjectWithHttpMessagesAsync(body, group, version, plural, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified cluster scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom object's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// The duration in seconds before the object should be deleted. Value must be + /// non-negative integer. The value zero indicates delete immediately. If this + /// value is nil, the default grace period for the specified type will be used. + /// Defaults to a per object value if not specified. zero means delete + /// immediately. + /// + /// + /// Deprecated: please use the PropagationPolicy, this field will be deprecated + /// in 1.7. Should the dependent objects be orphaned. If true/false, the + /// "orphan" finalizer will be added to/removed from the object's finalizers + /// list. Either this field or PropagationPolicy may be set, but not both. + /// + /// + /// Whether and how garbage collection will be performed. Either this field or + /// OrphanDependents may be set, but not both. The default policy is decided by + /// the existing finalizer set in the metadata.finalizers and the + /// resource-specific default policy. + /// + public static object DeleteClusterCustomObject(this IKubernetes operations, V1DeleteOptions body, string group, string version, string plural, string name, int? gracePeriodSeconds = default(int?), bool? orphanDependents = default(bool?), string propagationPolicy = default(string)) + { + return operations.DeleteClusterCustomObjectAsync(body, group, version, plural, name, gracePeriodSeconds, orphanDependents, propagationPolicy).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified cluster scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom object's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// The duration in seconds before the object should be deleted. Value must be + /// non-negative integer. The value zero indicates delete immediately. If this + /// value is nil, the default grace period for the specified type will be used. + /// Defaults to a per object value if not specified. zero means delete + /// immediately. + /// + /// + /// Deprecated: please use the PropagationPolicy, this field will be deprecated + /// in 1.7. Should the dependent objects be orphaned. If true/false, the + /// "orphan" finalizer will be added to/removed from the object's finalizers + /// list. Either this field or PropagationPolicy may be set, but not both. + /// + /// + /// Whether and how garbage collection will be performed. Either this field or + /// OrphanDependents may be set, but not both. The default policy is decided by + /// the existing finalizer set in the metadata.finalizers and the + /// resource-specific default policy. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteClusterCustomObjectAsync(this IKubernetes operations, V1DeleteOptions body, string group, string version, string plural, string name, int? gracePeriodSeconds = default(int?), bool? orphanDependents = default(bool?), string propagationPolicy = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteClusterCustomObjectWithHttpMessagesAsync(body, group, version, plural, name, gracePeriodSeconds, orphanDependents, propagationPolicy, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns a cluster scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom object's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + public static object GetClusterCustomObject(this IKubernetes operations, string group, string version, string plural, string name) + { + return operations.GetClusterCustomObjectAsync(group, version, plural, name).GetAwaiter().GetResult(); + } + + /// + /// Returns a cluster scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// the custom object's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// The cancellation token. + /// + public static async Task GetClusterCustomObjectAsync(this IKubernetes operations, string group, string version, string plural, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetClusterCustomObjectWithHttpMessagesAsync(group, version, plural, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// replace status of the specified namespace scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + public static object ReplaceNamespacedCustomObjectStatus(this IKubernetes operations, object body, string group, string version, string namespaceParameter, string plural, string name) + { + return operations.ReplaceNamespacedCustomObjectStatusAsync(body, group, version, namespaceParameter, plural, name).GetAwaiter().GetResult(); + } + + /// + /// replace status of the specified namespace scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// The cancellation token. + /// + public static async Task ReplaceNamespacedCustomObjectStatusAsync(this IKubernetes operations, object body, string group, string version, string namespaceParameter, string plural, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ReplaceNamespacedCustomObjectStatusWithHttpMessagesAsync(body, group, version, namespaceParameter, plural, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// partially update status of the specified namespace scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + public static object PatchNamespacedCustomObjectStatus(this IKubernetes operations, object body, string group, string version, string namespaceParameter, string plural, string name) + { + return operations.PatchNamespacedCustomObjectStatusAsync(body, group, version, namespaceParameter, plural, name).GetAwaiter().GetResult(); + } + + /// + /// partially update status of the specified namespace scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// The cancellation token. + /// + public static async Task PatchNamespacedCustomObjectStatusAsync(this IKubernetes operations, object body, string group, string version, string namespaceParameter, string plural, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PatchNamespacedCustomObjectStatusWithHttpMessagesAsync(body, group, version, namespaceParameter, plural, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// read status of the specified namespace scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + public static object GetNamespacedCustomObjectStatus(this IKubernetes operations, string group, string version, string namespaceParameter, string plural, string name) + { + return operations.GetNamespacedCustomObjectStatusAsync(group, version, namespaceParameter, plural, name).GetAwaiter().GetResult(); + } + + /// + /// read status of the specified namespace scoped custom object + /// + /// + /// The operations group for this extension method. + /// + /// + /// the custom resource's group + /// + /// + /// the custom resource's version + /// + /// + /// The custom resource's namespace + /// + /// + /// the custom resource's plural name. For TPRs this would be lowercase plural + /// kind. + /// + /// + /// the custom object's name + /// + /// + /// The cancellation token. + /// + public static async Task GetNamespacedCustomObjectStatusAsync(this IKubernetes operations, string group, string version, string namespaceParameter, string plural, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetNamespacedCustomObjectStatusWithHttpMessagesAsync(group, version, namespaceParameter, plural, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/src/KubernetesClient/generated/swagger.json b/src/KubernetesClient/generated/swagger.json index 577b05e..af77607 100644 --- a/src/KubernetesClient/generated/swagger.json +++ b/src/KubernetesClient/generated/swagger.json @@ -64524,124 +64524,6 @@ } } }, - "/apis/{group}/{version}/{plural}": { - "post": { - "responses": { - "201": { - "description": "Created", - "schema": { - "type": "object" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "description": "Creates a cluster scoped Custom object", - "parameters": [ - { - "schema": { - "type": "object" - }, - "description": "The JSON schema of the Resource to create.", - "required": true, - "name": "body", - "in": "body" - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "custom_objects" - ], - "operationId": "createClusterCustomObject" - }, - "parameters": [ - { - "uniqueItems": true, - "in": "query", - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty" - }, - { - "description": "The custom resource's group name", - "required": true, - "type": "string", - "name": "group", - "in": "path" - }, - { - "description": "The custom resource's version", - "required": true, - "type": "string", - "name": "version", - "in": "path" - }, - { - "description": "The custom resource's plural name. For TPRs this would be lowercase plural kind.", - "required": true, - "type": "string", - "name": "plural", - "in": "path" - } - ], - "get": { - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "object" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "description": "list or watch cluster scoped custom objects", - "parameters": [ - { - "uniqueItems": true, - "in": "query", - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector" - }, - { - "uniqueItems": true, - "in": "query", - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion" - }, - { - "uniqueItems": true, - "in": "query", - "type": "boolean", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications." - } - ], - "tags": [ - "custom_objects" - ], - "produces": [ - "application/json", - "application/json;stream=watch" - ], - "consumes": [ - "*/*" - ], - "operationId": "listClusterCustomObject" - } - }, "/apis/{group}/{version}/namespaces/{namespace}/{plural}": { "post": { "responses": { @@ -64767,8 +64649,73 @@ "operationId": "listNamespacedCustomObject" } }, - "/apis/{group}/{version}/{plural}/{name}": { - "put": { + "/apis/{group}/{version}/{plural}": { + "post": { + "responses": { + "201": { + "description": "Created", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + }, + "schemes": [ + "https" + ], + "description": "Creates a cluster scoped Custom object", + "parameters": [ + { + "schema": { + "type": "object" + }, + "description": "The JSON schema of the Resource to create.", + "required": true, + "name": "body", + "in": "body" + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "custom_objects" + ], + "operationId": "createClusterCustomObject" + }, + "parameters": [ + { + "uniqueItems": true, + "in": "query", + "type": "string", + "description": "If 'true', then the output is pretty printed.", + "name": "pretty" + }, + { + "description": "The custom resource's group name", + "required": true, + "type": "string", + "name": "group", + "in": "path" + }, + { + "description": "The custom resource's version", + "required": true, + "type": "string", + "name": "version", + "in": "path" + }, + { + "description": "The custom resource's plural name. For TPRs this would be lowercase plural kind.", + "required": true, + "type": "string", + "name": "plural", + "in": "path" + } + ], + "get": { "responses": { "200": { "description": "OK", @@ -64783,20 +64730,80 @@ "schemes": [ "https" ], - "description": "replace the specified cluster scoped custom object", + "description": "list or watch cluster scoped custom objects", + "parameters": [ + { + "uniqueItems": true, + "in": "query", + "type": "string", + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "name": "labelSelector" + }, + { + "uniqueItems": true, + "in": "query", + "type": "string", + "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", + "name": "resourceVersion" + }, + { + "uniqueItems": true, + "in": "query", + "type": "boolean", + "name": "watch", + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications." + } + ], + "tags": [ + "custom_objects" + ], + "produces": [ + "application/json", + "application/json;stream=watch" + ], + "consumes": [ + "*/*" + ], + "operationId": "listClusterCustomObject" + } + }, + "/apis/{group}/{version}/{plural}/{name}/status": { + "put": { + "responses": { + "201": { + "description": "Created", + "schema": { + "type": "object" + } + }, + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + }, + "schemes": [ + "https" + ], + "description": "replace status of the cluster scoped specified custom object", "parameters": [ { "schema": { "type": "object" }, - "description": "The JSON schema of the Resource to replace.", "required": true, "name": "body", "in": "body" } ], "produces": [ - "application/json" + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" ], "tags": [ "custom_objects" @@ -64804,7 +64811,7 @@ "consumes": [ "*/*" ], - "operationId": "replaceClusterCustomObject" + "operationId": "replaceClusterCustomObjectStatus" }, "patch": { "responses": { @@ -64821,20 +64828,22 @@ "schemes": [ "https" ], - "description": "patch the specified cluster scoped custom object", + "description": "partially update status of the specified cluster scoped custom object", "parameters": [ { "schema": { - "type": "object" + "type": "object", + "description": "The JSON schema of the Resource to patch." }, - "description": "The JSON schema of the Resource to patch.", "required": true, "name": "body", "in": "body" } ], "produces": [ - "application/json" + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" ], "tags": [ "custom_objects" @@ -64842,65 +64851,7 @@ "consumes": [ "application/merge-patch+json" ], - "operationId": "patchClusterCustomObject" - }, - "delete": { - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "object" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "description": "Deletes the specified cluster scoped custom object", - "parameters": [ - { - "schema": { - "$ref": "#/definitions/v1.DeleteOptions" - }, - "required": true, - "name": "body", - "in": "body" - }, - { - "uniqueItems": true, - "in": "query", - "type": "integer", - "name": "gracePeriodSeconds", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately." - }, - { - "uniqueItems": true, - "in": "query", - "type": "boolean", - "name": "orphanDependents", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both." - }, - { - "uniqueItems": true, - "in": "query", - "type": "string", - "name": "propagationPolicy", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy." - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "custom_objects" - ], - "consumes": [ - "*/*" - ], - "operationId": "deleteClusterCustomObject" + "operationId": "patchClusterCustomObjectStatus" }, "parameters": [ { @@ -64918,7 +64869,7 @@ "in": "path" }, { - "description": "the custom object's plural name. For TPRs this would be lowercase plural kind.", + "description": "the custom resource's plural name. For TPRs this would be lowercase plural kind.", "required": true, "type": "string", "name": "plural", @@ -64935,7 +64886,7 @@ "get": { "responses": { "200": { - "description": "A single Resource", + "description": "OK", "schema": { "type": "object" } @@ -64947,9 +64898,11 @@ "schemes": [ "https" ], - "description": "Returns a cluster scoped custom object", + "description": "read status of the specified cluster scoped custom object", "produces": [ - "application/json" + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" ], "tags": [ "custom_objects" @@ -64957,7 +64910,7 @@ "consumes": [ "*/*" ], - "operationId": "getClusterCustomObject" + "operationId": "getClusterCustomObjectStatus" } }, "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}": { @@ -65159,6 +65112,651 @@ ], "operationId": "getNamespacedCustomObject" } + }, + "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale": { + "put": { + "responses": { + "201": { + "description": "Created", + "schema": { + "type": "object" + } + }, + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + }, + "schemes": [ + "https" + ], + "description": "replace scale of the specified namespace scoped custom object", + "parameters": [ + { + "schema": { + "type": "object" + }, + "required": true, + "name": "body", + "in": "body" + } + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "tags": [ + "custom_objects" + ], + "consumes": [ + "*/*" + ], + "operationId": "replaceNamespacedCustomObjectScale" + }, + "patch": { + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + }, + "schemes": [ + "https" + ], + "description": "partially update scale of the specified namespace scoped custom object", + "parameters": [ + { + "schema": { + "type": "object", + "description": "The JSON schema of the Resource to patch." + }, + "required": true, + "name": "body", + "in": "body" + } + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "tags": [ + "custom_objects" + ], + "consumes": [ + "application/merge-patch+json" + ], + "operationId": "patchNamespacedCustomObjectScale" + }, + "parameters": [ + { + "description": "the custom resource's group", + "required": true, + "type": "string", + "name": "group", + "in": "path" + }, + { + "description": "the custom resource's version", + "required": true, + "type": "string", + "name": "version", + "in": "path" + }, + { + "description": "The custom resource's namespace", + "required": true, + "type": "string", + "name": "namespace", + "in": "path" + }, + { + "description": "the custom resource's plural name. For TPRs this would be lowercase plural kind.", + "required": true, + "type": "string", + "name": "plural", + "in": "path" + }, + { + "description": "the custom object's name", + "required": true, + "type": "string", + "name": "name", + "in": "path" + } + ], + "get": { + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + }, + "schemes": [ + "https" + ], + "description": "read scale of the specified namespace scoped custom object", + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "tags": [ + "custom_objects" + ], + "consumes": [ + "*/*" + ], + "operationId": "getNamespacedCustomObjectScale" + } + }, + "/apis/{group}/{version}/{plural}/{name}/scale": { + "put": { + "responses": { + "201": { + "description": "Created", + "schema": { + "type": "object" + } + }, + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + }, + "schemes": [ + "https" + ], + "description": "replace scale of the specified cluster scoped custom object", + "parameters": [ + { + "schema": { + "type": "object" + }, + "required": true, + "name": "body", + "in": "body" + } + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "tags": [ + "custom_objects" + ], + "consumes": [ + "*/*" + ], + "operationId": "replaceClusterCustomObjectScale" + }, + "patch": { + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + }, + "schemes": [ + "https" + ], + "description": "partially update scale of the specified cluster scoped custom object", + "parameters": [ + { + "schema": { + "type": "object", + "description": "The JSON schema of the Resource to patch." + }, + "required": true, + "name": "body", + "in": "body" + } + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "tags": [ + "custom_objects" + ], + "consumes": [ + "application/merge-patch+json" + ], + "operationId": "patchClusterCustomObjectScale" + }, + "parameters": [ + { + "description": "the custom resource's group", + "required": true, + "type": "string", + "name": "group", + "in": "path" + }, + { + "description": "the custom resource's version", + "required": true, + "type": "string", + "name": "version", + "in": "path" + }, + { + "description": "the custom resource's plural name. For TPRs this would be lowercase plural kind.", + "required": true, + "type": "string", + "name": "plural", + "in": "path" + }, + { + "description": "the custom object's name", + "required": true, + "type": "string", + "name": "name", + "in": "path" + } + ], + "get": { + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + }, + "schemes": [ + "https" + ], + "description": "read scale of the specified custom object", + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "tags": [ + "custom_objects" + ], + "consumes": [ + "*/*" + ], + "operationId": "getClusterCustomObjectScale" + } + }, + "/apis/{group}/{version}/{plural}/{name}": { + "put": { + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + }, + "schemes": [ + "https" + ], + "description": "replace the specified cluster scoped custom object", + "parameters": [ + { + "schema": { + "type": "object" + }, + "description": "The JSON schema of the Resource to replace.", + "required": true, + "name": "body", + "in": "body" + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "custom_objects" + ], + "consumes": [ + "*/*" + ], + "operationId": "replaceClusterCustomObject" + }, + "patch": { + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + }, + "schemes": [ + "https" + ], + "description": "patch the specified cluster scoped custom object", + "parameters": [ + { + "schema": { + "type": "object" + }, + "description": "The JSON schema of the Resource to patch.", + "required": true, + "name": "body", + "in": "body" + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "custom_objects" + ], + "consumes": [ + "application/merge-patch+json" + ], + "operationId": "patchClusterCustomObject" + }, + "delete": { + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + }, + "schemes": [ + "https" + ], + "description": "Deletes the specified cluster scoped custom object", + "parameters": [ + { + "schema": { + "$ref": "#/definitions/v1.DeleteOptions" + }, + "required": true, + "name": "body", + "in": "body" + }, + { + "uniqueItems": true, + "in": "query", + "type": "integer", + "name": "gracePeriodSeconds", + "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately." + }, + { + "uniqueItems": true, + "in": "query", + "type": "boolean", + "name": "orphanDependents", + "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both." + }, + { + "uniqueItems": true, + "in": "query", + "type": "string", + "name": "propagationPolicy", + "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy." + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "custom_objects" + ], + "consumes": [ + "*/*" + ], + "operationId": "deleteClusterCustomObject" + }, + "parameters": [ + { + "description": "the custom resource's group", + "required": true, + "type": "string", + "name": "group", + "in": "path" + }, + { + "description": "the custom resource's version", + "required": true, + "type": "string", + "name": "version", + "in": "path" + }, + { + "description": "the custom object's plural name. For TPRs this would be lowercase plural kind.", + "required": true, + "type": "string", + "name": "plural", + "in": "path" + }, + { + "description": "the custom object's name", + "required": true, + "type": "string", + "name": "name", + "in": "path" + } + ], + "get": { + "responses": { + "200": { + "description": "A single Resource", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + }, + "schemes": [ + "https" + ], + "description": "Returns a cluster scoped custom object", + "produces": [ + "application/json" + ], + "tags": [ + "custom_objects" + ], + "consumes": [ + "*/*" + ], + "operationId": "getClusterCustomObject" + } + }, + "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status": { + "put": { + "responses": { + "201": { + "description": "Created", + "schema": { + "type": "object" + } + }, + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + }, + "schemes": [ + "https" + ], + "description": "replace status of the specified namespace scoped custom object", + "parameters": [ + { + "schema": { + "type": "object" + }, + "required": true, + "name": "body", + "in": "body" + } + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "tags": [ + "custom_objects" + ], + "consumes": [ + "*/*" + ], + "operationId": "replaceNamespacedCustomObjectStatus" + }, + "patch": { + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + }, + "schemes": [ + "https" + ], + "description": "partially update status of the specified namespace scoped custom object", + "parameters": [ + { + "schema": { + "type": "object", + "description": "The JSON schema of the Resource to patch." + }, + "required": true, + "name": "body", + "in": "body" + } + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "tags": [ + "custom_objects" + ], + "consumes": [ + "application/merge-patch+json" + ], + "operationId": "patchNamespacedCustomObjectStatus" + }, + "parameters": [ + { + "description": "the custom resource's group", + "required": true, + "type": "string", + "name": "group", + "in": "path" + }, + { + "description": "the custom resource's version", + "required": true, + "type": "string", + "name": "version", + "in": "path" + }, + { + "description": "The custom resource's namespace", + "required": true, + "type": "string", + "name": "namespace", + "in": "path" + }, + { + "description": "the custom resource's plural name. For TPRs this would be lowercase plural kind.", + "required": true, + "type": "string", + "name": "plural", + "in": "path" + }, + { + "description": "the custom object's name", + "required": true, + "type": "string", + "name": "name", + "in": "path" + } + ], + "get": { + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + }, + "schemes": [ + "https" + ], + "description": "read status of the specified namespace scoped custom object", + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "tags": [ + "custom_objects" + ], + "consumes": [ + "*/*" + ], + "operationId": "getNamespacedCustomObjectStatus" + } } }, "definitions": {