diff --git a/src/KubernetesClient/generated/IKubernetes.cs b/src/KubernetesClient/generated/IKubernetes.cs index cfb93c96..547ad4c2 100644 --- a/src/KubernetesClient/generated/IKubernetes.cs +++ b/src/KubernetesClient/generated/IKubernetes.cs @@ -29122,7 +29122,7 @@ public partial interface IKubernetes : System.IDisposable Task> GetCodeWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates a cluster scoped Custom object + /// Creates a namespace scoped Custom object /// /// /// The JSON schema of the Resource to create. @@ -29133,6 +29133,9 @@ public partial interface IKubernetes : System.IDisposable /// /// The custom resource's version /// + /// + /// The custom resource's namespace + /// /// /// The custom resource's plural name. For TPRs this would be lowercase /// plural kind. @@ -29146,10 +29149,10 @@ public partial interface IKubernetes : System.IDisposable /// /// The cancellation token. /// - Task> CreateClusterCustomObjectWithHttpMessagesAsync(object body, string group, string version, string plural, string pretty = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateNamespacedCustomObjectWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string pretty = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// list or watch cluster scoped custom objects + /// list or watch namespace scoped custom objects /// /// /// The custom resource's group name @@ -29157,6 +29160,9 @@ public partial interface IKubernetes : System.IDisposable /// /// The custom resource's version /// + /// + /// The custom resource's namespace + /// /// /// The custom resource's plural name. For TPRs this would be lowercase /// plural kind. @@ -29187,10 +29193,10 @@ public partial interface IKubernetes : System.IDisposable /// /// 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)); + 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)); /// - /// Creates a namespace scoped Custom object + /// Creates a cluster scoped Custom object /// /// /// The JSON schema of the Resource to create. @@ -29201,9 +29207,6 @@ public partial interface IKubernetes : System.IDisposable /// /// The custom resource's version /// - /// - /// The custom resource's namespace - /// /// /// The custom resource's plural name. For TPRs this would be lowercase /// plural kind. @@ -29217,10 +29220,10 @@ public partial interface IKubernetes : System.IDisposable /// /// The cancellation token. /// - Task> CreateNamespacedCustomObjectWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string pretty = default(string), 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)); /// - /// list or watch namespace scoped custom objects + /// list or watch cluster scoped custom objects /// /// /// The custom resource's group name @@ -29228,9 +29231,6 @@ public partial interface IKubernetes : System.IDisposable /// /// The custom resource's version /// - /// - /// The custom resource's namespace - /// /// /// The custom resource's plural name. For TPRs this would be lowercase /// plural kind. @@ -29261,10 +29261,87 @@ public partial interface IKubernetes : System.IDisposable /// /// The cancellation token. /// - 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)); + 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)); /// - /// replace the specified cluster scoped custom object + /// replace status of the cluster scoped 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> ReplaceClusterCustomObjectStatusWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// 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 + /// + /// + /// 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> GetClusterCustomObjectStatusWithHttpMessagesAsync(string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// replace the specified namespace scoped custom object /// /// /// The JSON schema of the Resource to replace. @@ -29275,8 +29352,11 @@ public partial interface IKubernetes : System.IDisposable /// /// the custom resource's version /// + /// + /// The custom resource's namespace + /// /// - /// 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. /// /// @@ -29288,10 +29368,10 @@ public partial interface IKubernetes : System.IDisposable /// /// The cancellation token. /// - Task> ReplaceClusterCustomObjectWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ReplaceNamespacedCustomObjectWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// patch the specified cluster scoped custom object + /// patch the specified namespace scoped custom object /// /// /// The JSON schema of the Resource to patch. @@ -29302,8 +29382,11 @@ public partial interface IKubernetes : System.IDisposable /// /// the custom resource's version /// + /// + /// The custom resource's namespace + /// /// - /// 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. /// /// @@ -29315,10 +29398,10 @@ public partial interface IKubernetes : System.IDisposable /// /// The cancellation token. /// - Task> PatchClusterCustomObjectWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> PatchNamespacedCustomObjectWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified cluster scoped custom object + /// Deletes the specified namespace scoped custom object /// /// /// @@ -29328,8 +29411,11 @@ public partial interface IKubernetes : System.IDisposable /// /// the custom resource's version /// + /// + /// The custom resource's namespace + /// /// - /// 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. /// /// @@ -29361,10 +29447,10 @@ public partial interface IKubernetes : System.IDisposable /// /// 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> DeleteNamespacedCustomObjectWithHttpMessagesAsync(V1DeleteOptions body, string group, string version, string namespaceParameter, 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 + /// Returns a namespace scoped custom object /// /// /// the custom resource's group @@ -29372,8 +29458,11 @@ public partial interface IKubernetes : System.IDisposable /// /// the custom resource's version /// + /// + /// The custom resource's namespace + /// /// - /// 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,13 +29474,12 @@ public partial interface IKubernetes : System.IDisposable /// /// The cancellation token. /// - Task> GetClusterCustomObjectWithHttpMessagesAsync(string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetNamespacedCustomObjectWithHttpMessagesAsync(string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// replace the specified namespace scoped custom object + /// replace scale of the specified namespace scoped custom object /// /// - /// The JSON schema of the Resource to replace. /// /// /// the custom resource's group @@ -29415,13 +29503,13 @@ public partial interface IKubernetes : System.IDisposable /// /// The cancellation token. /// - Task> ReplaceNamespacedCustomObjectWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ReplaceNamespacedCustomObjectScaleWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// patch the specified namespace scoped custom object + /// partially update scale of the specified namespace scoped custom + /// object /// /// - /// The JSON schema of the Resource to patch. /// /// /// the custom resource's group @@ -29445,13 +29533,11 @@ public partial interface IKubernetes : System.IDisposable /// /// The cancellation token. /// - Task> PatchNamespacedCustomObjectWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> PatchNamespacedCustomObjectScaleWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified namespace scoped custom object + /// read scale of the specified namespace scoped custom object /// - /// - /// /// /// the custom resource's group /// @@ -29468,6 +29554,163 @@ public partial interface IKubernetes : System.IDisposable /// /// 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 @@ -29494,10 +29737,10 @@ public partial interface IKubernetes : System.IDisposable /// /// The cancellation token. /// - Task> DeleteNamespacedCustomObjectWithHttpMessagesAsync(V1DeleteOptions body, string group, string version, string namespaceParameter, string plural, string name, int? gracePeriodSeconds = default(int?), bool? orphanDependents = default(bool?), string propagationPolicy = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + 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 namespace scoped custom object + /// Returns a cluster scoped custom object /// /// /// the custom resource's group @@ -29505,6 +29748,32 @@ public partial interface IKubernetes : System.IDisposable /// /// 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 /// @@ -29521,7 +29790,64 @@ public partial interface IKubernetes : System.IDisposable /// /// The cancellation token. /// - Task> GetNamespacedCustomObjectWithHttpMessagesAsync(string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + 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 93465e6d..a46b9870 100644 --- a/src/KubernetesClient/generated/Kubernetes.cs +++ b/src/KubernetesClient/generated/Kubernetes.cs @@ -152842,7 +152842,7 @@ private void Initialize() } /// - /// Creates a cluster scoped Custom object + /// Creates a namespace scoped Custom object /// /// /// The JSON schema of the Resource to create. @@ -152853,6 +152853,9 @@ private void Initialize() /// /// The custom resource's version /// + /// + /// The custom resource's namespace + /// /// /// The custom resource's plural name. For TPRs this would be lowercase plural /// kind. @@ -152881,7 +152884,7 @@ private void Initialize() /// /// 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)) + public async Task> CreateNamespacedCustomObjectWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string pretty = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (body == null) { @@ -152895,6 +152898,10 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "version"); } + if (namespaceParameter == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceParameter"); + } if (plural == null) { throw new ValidationException(ValidationRules.CannotBeNull, "plural"); @@ -152910,15 +152917,17 @@ private void Initialize() tracingParameters.Add("pretty", pretty); tracingParameters.Add("group", group); tracingParameters.Add("version", version); + tracingParameters.Add("namespaceParameter", namespaceParameter); tracingParameters.Add("plural", plural); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateClusterCustomObject", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateNamespacedCustomObject", tracingParameters); } // Construct URL var _baseUrl = BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/namespaces/{namespace}/{plural}").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)); List _queryParameters = new List(); if (pretty != null) @@ -153029,7 +153038,7 @@ private void Initialize() } /// - /// list or watch cluster scoped custom objects + /// list or watch namespace scoped custom objects /// /// /// The custom resource's group name @@ -153037,6 +153046,9 @@ private void Initialize() /// /// The custom resource's version /// + /// + /// The custom resource's namespace + /// /// /// The custom resource's plural name. For TPRs this would be lowercase plural /// kind. @@ -153081,7 +153093,7 @@ private void Initialize() /// /// 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)) + public async 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)) { if (group == null) { @@ -153091,6 +153103,10 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "version"); } + if (namespaceParameter == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceParameter"); + } if (plural == null) { throw new ValidationException(ValidationRules.CannotBeNull, "plural"); @@ -153108,15 +153124,17 @@ private void Initialize() tracingParameters.Add("pretty", pretty); tracingParameters.Add("group", group); tracingParameters.Add("version", version); + tracingParameters.Add("namespaceParameter", namespaceParameter); tracingParameters.Add("plural", plural); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListClusterCustomObject", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNamespacedCustomObject", tracingParameters); } // Construct URL var _baseUrl = BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/{plural}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/namespaces/{namespace}/{plural}").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)); List _queryParameters = new List(); if (labelSelector != null) @@ -153233,7 +153251,7 @@ private void Initialize() } /// - /// Creates a namespace scoped Custom object + /// Creates a cluster scoped Custom object /// /// /// The JSON schema of the Resource to create. @@ -153244,9 +153262,6 @@ private void Initialize() /// /// The custom resource's version /// - /// - /// The custom resource's namespace - /// /// /// The custom resource's plural name. For TPRs this would be lowercase plural /// kind. @@ -153275,7 +153290,7 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> CreateNamespacedCustomObjectWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string pretty = default(string), 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) { @@ -153289,10 +153304,6 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "version"); } - if (namespaceParameter == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceParameter"); - } if (plural == null) { throw new ValidationException(ValidationRules.CannotBeNull, "plural"); @@ -153308,17 +153319,15 @@ private void Initialize() tracingParameters.Add("pretty", pretty); tracingParameters.Add("group", group); tracingParameters.Add("version", version); - tracingParameters.Add("namespaceParameter", namespaceParameter); tracingParameters.Add("plural", plural); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateNamespacedCustomObject", 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}/namespaces/{namespace}/{plural}").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("{namespace}", System.Uri.EscapeDataString(namespaceParameter)); _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); List _queryParameters = new List(); if (pretty != null) @@ -153429,7 +153438,7 @@ private void Initialize() } /// - /// list or watch namespace scoped custom objects + /// list or watch cluster scoped custom objects /// /// /// The custom resource's group name @@ -153437,9 +153446,6 @@ private void Initialize() /// /// The custom resource's version /// - /// - /// The custom resource's namespace - /// /// /// The custom resource's plural name. For TPRs this would be lowercase plural /// kind. @@ -153484,7 +153490,7 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async 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)) + 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) { @@ -153494,10 +153500,6 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "version"); } - if (namespaceParameter == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceParameter"); - } if (plural == null) { throw new ValidationException(ValidationRules.CannotBeNull, "plural"); @@ -153515,17 +153517,15 @@ private void Initialize() tracingParameters.Add("pretty", pretty); tracingParameters.Add("group", group); tracingParameters.Add("version", version); - tracingParameters.Add("namespaceParameter", namespaceParameter); tracingParameters.Add("plural", plural); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNamespacedCustomObject", tracingParameters); + 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}/namespaces/{namespace}/{plural}").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("{namespace}", System.Uri.EscapeDataString(namespaceParameter)); _url = _url.Replace("{plural}", System.Uri.EscapeDataString(plural)); List _queryParameters = new List(); if (labelSelector != null) @@ -153642,10 +153642,9 @@ private void Initialize() } /// - /// replace the specified cluster scoped custom object + /// replace status of the cluster scoped specified custom object /// /// - /// The JSON schema of the Resource to replace. /// /// /// the custom resource's group @@ -153654,7 +153653,7 @@ private void Initialize() /// 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. /// /// @@ -153681,7 +153680,7 @@ private void Initialize() /// /// 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> ReplaceClusterCustomObjectStatusWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (body == null) { @@ -153716,11 +153715,11 @@ private void Initialize() tracingParameters.Add("plural", plural); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ReplaceClusterCustomObject", 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)); @@ -153773,7 +153772,7 @@ private void Initialize() HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 401) + 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) { @@ -153817,6 +153816,24 @@ private void Initialize() 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); @@ -153825,10 +153842,9 @@ private void Initialize() } /// - /// patch the specified cluster scoped custom object + /// partially update status of the specified cluster scoped custom object /// /// - /// The JSON schema of the Resource to patch. /// /// /// the custom resource's group @@ -153837,7 +153853,7 @@ private void Initialize() /// 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 +153880,7 @@ private void Initialize() /// /// 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> PatchClusterCustomObjectStatusWithHttpMessagesAsync(object body, string group, string version, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (body == null) { @@ -153899,11 +153915,11 @@ private void Initialize() tracingParameters.Add("plural", plural); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "PatchClusterCustomObject", tracingParameters); + 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}").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)); @@ -154008,10 +154024,8 @@ private void Initialize() } /// - /// Deletes the specified cluster scoped custom object + /// read status of the specified cluster scoped custom object /// - /// - /// /// /// the custom resource's group /// @@ -154019,31 +154033,12 @@ private void Initialize() /// 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. - /// /// /// Headers that will be added to request. /// @@ -154065,12 +154060,8 @@ private void Initialize() /// /// 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)) + public async Task> GetClusterCustomObjectStatusWithHttpMessagesAsync(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"); @@ -154094,45 +154085,24 @@ private void Initialize() { _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); + 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)); _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.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers @@ -154151,12 +154121,6 @@ private void Initialize() // 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) { @@ -154229,16 +154193,22 @@ private void Initialize() } /// - /// Returns a cluster scoped custom object + /// replace the specified namespace scoped custom object /// + /// + /// The JSON schema of the Resource to replace. + /// /// /// the custom resource's group /// /// /// the custom resource's version /// + /// + /// The custom resource's namespace + /// /// - /// 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,8 +154235,12 @@ private void Initialize() /// /// 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> ReplaceNamespacedCustomObjectWithHttpMessagesAsync(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"); @@ -154275,6 +154249,10 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "version"); } + if (namespaceParameter == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceParameter"); + } if (plural == null) { throw new ValidationException(ValidationRules.CannotBeNull, "plural"); @@ -154290,24 +154268,27 @@ private void Initialize() { _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, "GetClusterCustomObject", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ReplaceNamespacedCustomObject", 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}/namespaces/{namespace}/{plural}/{name}").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.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers @@ -154326,6 +154307,12 @@ private void Initialize() // 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) { @@ -154398,10 +154385,10 @@ private void Initialize() } /// - /// replace the specified namespace scoped custom object + /// patch the specified namespace scoped custom object /// /// - /// The JSON schema of the Resource to replace. + /// The JSON schema of the Resource to patch. /// /// /// the custom resource's group @@ -154440,7 +154427,7 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> ReplaceNamespacedCustomObjectWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> PatchNamespacedCustomObjectWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (body == null) { @@ -154480,7 +154467,7 @@ private void Initialize() tracingParameters.Add("plural", plural); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ReplaceNamespacedCustomObject", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "PatchNamespacedCustomObject", tracingParameters); } // Construct URL var _baseUrl = BaseUri.AbsoluteUri; @@ -154493,7 +154480,7 @@ private void Initialize() // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers @@ -154516,7 +154503,7 @@ private void Initialize() { _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"); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/merge-patch+json"); } // Set Credentials if (Credentials != null) @@ -154590,10 +154577,9 @@ private void Initialize() } /// - /// patch the specified namespace scoped custom object + /// Deletes the specified namespace scoped custom object /// /// - /// The JSON schema of the Resource to patch. /// /// /// the custom resource's group @@ -154611,6 +154597,25 @@ private void Initialize() /// /// 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. /// @@ -154632,7 +154637,7 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> PatchNamespacedCustomObjectWithHttpMessagesAsync(object body, string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteNamespacedCustomObjectWithHttpMessagesAsync(V1DeleteOptions body, string group, string version, string namespaceParameter, 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) { @@ -154666,13 +154671,16 @@ private void Initialize() _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("namespaceParameter", namespaceParameter); tracingParameters.Add("plural", plural); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "PatchNamespacedCustomObject", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteNamespacedCustomObject", tracingParameters); } // Construct URL var _baseUrl = BaseUri.AbsoluteUri; @@ -154682,10 +154690,2096 @@ private void Initialize() _url = _url.Replace("{namespace}", System.Uri.EscapeDataString(namespaceParameter)); _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("PATCH"); + _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 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> GetNamespacedCustomObjectWithHttpMessagesAsync(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, "GetNamespacedCustomObject", 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}").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 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 @@ -154704,12 +156798,6 @@ private void Initialize() // 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) { @@ -154782,7 +156870,7 @@ private void Initialize() } /// - /// Deletes the specified namespace scoped custom object + /// replace status of the specified namespace scoped custom object /// /// /// @@ -154802,25 +156890,6 @@ private void Initialize() /// /// 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. /// @@ -154842,7 +156911,7 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> DeleteNamespacedCustomObjectWithHttpMessagesAsync(V1DeleteOptions body, string group, string version, string namespaceParameter, string plural, string name, int? gracePeriodSeconds = default(int?), bool? orphanDependents = default(bool?), string propagationPolicy = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + 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) { @@ -154876,46 +156945,235 @@ private void Initialize() _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("namespaceParameter", namespaceParameter); tracingParameters.Add("plural", plural); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteNamespacedCustomObject", tracingParameters); + 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}").ToString(); + 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)); - List _queryParameters = new List(); - if (gracePeriodSeconds != null) + // 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) { - _queryParameters.Add(string.Format("gracePeriodSeconds={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(gracePeriodSeconds, SerializationSettings).Trim('"')))); + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } } - if (orphanDependents != null) + + // Serialize Request + string _requestContent = null; + if(body != null) { - _queryParameters.Add(string.Format("orphanDependents={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(orphanDependents, SerializationSettings).Trim('"')))); + _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"); } - if (propagationPolicy != null) + // Set Credentials + if (Credentials != null) { - _queryParameters.Add(string.Format("propagationPolicy={0}", System.Uri.EscapeDataString(propagationPolicy))); + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } - if (_queryParameters.Count > 0) + // Send Request + if (_shouldTrace) { - _url += "?" + string.Join("&", _queryParameters); + 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("DELETE"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers @@ -154938,7 +157196,7 @@ private void Initialize() { _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"); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/merge-patch+json"); } // Set Credentials if (Credentials != null) @@ -155012,7 +157270,7 @@ private void Initialize() } /// - /// Returns a namespace scoped custom object + /// read status of the specified namespace scoped custom object /// /// /// the custom resource's group @@ -155051,7 +157309,7 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> GetNamespacedCustomObjectWithHttpMessagesAsync(string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetNamespacedCustomObjectStatusWithHttpMessagesAsync(string group, string version, string namespaceParameter, string plural, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (group == null) { @@ -155086,11 +157344,11 @@ private void Initialize() tracingParameters.Add("plural", plural); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNamespacedCustomObject", tracingParameters); + 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}").ToString(); + 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)); diff --git a/src/KubernetesClient/generated/KubernetesExtensions.cs b/src/KubernetesClient/generated/KubernetesExtensions.cs index def7492a..233bb9c3 100644 --- a/src/KubernetesClient/generated/KubernetesExtensions.cs +++ b/src/KubernetesClient/generated/KubernetesExtensions.cs @@ -60346,7 +60346,7 @@ public static VersionInfo GetCode(this IKubernetes operations) } /// - /// Creates a cluster scoped Custom object + /// Creates a namespace scoped Custom object /// /// /// The operations group for this extension method. @@ -60360,6 +60360,9 @@ public static VersionInfo GetCode(this IKubernetes operations) /// /// The custom resource's version /// + /// + /// The custom resource's namespace + /// /// /// The custom resource's plural name. For TPRs this would be lowercase plural /// kind. @@ -60367,13 +60370,13 @@ public static VersionInfo GetCode(this IKubernetes operations) /// /// 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)) + public static object CreateNamespacedCustomObject(this IKubernetes operations, object body, string group, string version, string namespaceParameter, string plural, string pretty = default(string)) { - return operations.CreateClusterCustomObjectAsync(body, group, version, plural, pretty).GetAwaiter().GetResult(); + return operations.CreateNamespacedCustomObjectAsync(body, group, version, namespaceParameter, plural, pretty).GetAwaiter().GetResult(); } /// - /// Creates a cluster scoped Custom object + /// Creates a namespace scoped Custom object /// /// /// The operations group for this extension method. @@ -60387,6 +60390,9 @@ public static VersionInfo GetCode(this IKubernetes operations) /// /// The custom resource's version /// + /// + /// The custom resource's namespace + /// /// /// The custom resource's plural name. For TPRs this would be lowercase plural /// kind. @@ -60397,16 +60403,16 @@ public static VersionInfo GetCode(this IKubernetes operations) /// /// 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)) + public static async Task CreateNamespacedCustomObjectAsync(this IKubernetes operations, object body, string group, string version, string namespaceParameter, 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)) + using (var _result = await operations.CreateNamespacedCustomObjectWithHttpMessagesAsync(body, group, version, namespaceParameter, plural, pretty, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// list or watch cluster scoped custom objects + /// list or watch namespace scoped custom objects /// /// /// The operations group for this extension method. @@ -60417,6 +60423,9 @@ public static VersionInfo GetCode(this IKubernetes operations) /// /// The custom resource's version /// + /// + /// The custom resource's namespace + /// /// /// The custom resource's plural name. For TPRs this would be lowercase plural /// kind. @@ -60440,13 +60449,13 @@ public static VersionInfo GetCode(this IKubernetes operations) /// /// 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)) + public static object ListNamespacedCustomObject(this IKubernetes operations, string group, string version, string namespaceParameter, 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(); + return operations.ListNamespacedCustomObjectAsync(group, version, namespaceParameter, plural, labelSelector, resourceVersion, watch, pretty).GetAwaiter().GetResult(); } /// - /// list or watch cluster scoped custom objects + /// list or watch namespace scoped custom objects /// /// /// The operations group for this extension method. @@ -60457,6 +60466,9 @@ public static VersionInfo GetCode(this IKubernetes operations) /// /// The custom resource's version /// + /// + /// The custom resource's namespace + /// /// /// The custom resource's plural name. For TPRs this would be lowercase plural /// kind. @@ -60483,16 +60495,16 @@ public static VersionInfo GetCode(this IKubernetes operations) /// /// 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)) + public static async Task ListNamespacedCustomObjectAsync(this IKubernetes operations, string group, string version, string namespaceParameter, 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)) + using (var _result = await operations.ListNamespacedCustomObjectWithHttpMessagesAsync(group, version, namespaceParameter, plural, labelSelector, resourceVersion, watch, pretty, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates a namespace scoped Custom object + /// Creates a cluster scoped Custom object /// /// /// The operations group for this extension method. @@ -60506,9 +60518,6 @@ public static VersionInfo GetCode(this IKubernetes operations) /// /// The custom resource's version /// - /// - /// The custom resource's namespace - /// /// /// The custom resource's plural name. For TPRs this would be lowercase plural /// kind. @@ -60516,13 +60525,13 @@ public static VersionInfo GetCode(this IKubernetes operations) /// /// If 'true', then the output is pretty printed. /// - public static object CreateNamespacedCustomObject(this IKubernetes operations, object body, string group, string version, string namespaceParameter, string plural, string pretty = default(string)) + public static object CreateClusterCustomObject(this IKubernetes operations, object body, string group, string version, string plural, string pretty = default(string)) { - return operations.CreateNamespacedCustomObjectAsync(body, group, version, namespaceParameter, plural, pretty).GetAwaiter().GetResult(); + return operations.CreateClusterCustomObjectAsync(body, group, version, plural, pretty).GetAwaiter().GetResult(); } /// - /// Creates a namespace scoped Custom object + /// Creates a cluster scoped Custom object /// /// /// The operations group for this extension method. @@ -60536,9 +60545,6 @@ public static VersionInfo GetCode(this IKubernetes operations) /// /// The custom resource's version /// - /// - /// The custom resource's namespace - /// /// /// The custom resource's plural name. For TPRs this would be lowercase plural /// kind. @@ -60549,16 +60555,16 @@ public static VersionInfo GetCode(this IKubernetes operations) /// /// The cancellation token. /// - public static async Task CreateNamespacedCustomObjectAsync(this IKubernetes operations, object body, string group, string version, string namespaceParameter, string plural, string pretty = default(string), 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.CreateNamespacedCustomObjectWithHttpMessagesAsync(body, group, version, namespaceParameter, plural, pretty, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateClusterCustomObjectWithHttpMessagesAsync(body, group, version, plural, pretty, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// list or watch namespace scoped custom objects + /// list or watch cluster scoped custom objects /// /// /// The operations group for this extension method. @@ -60569,9 +60575,6 @@ public static VersionInfo GetCode(this IKubernetes operations) /// /// The custom resource's version /// - /// - /// The custom resource's namespace - /// /// /// The custom resource's plural name. For TPRs this would be lowercase plural /// kind. @@ -60595,13 +60598,13 @@ public static VersionInfo GetCode(this IKubernetes operations) /// /// If 'true', then the output is pretty printed. /// - public static object ListNamespacedCustomObject(this IKubernetes operations, string group, string version, string namespaceParameter, string plural, string labelSelector = default(string), string resourceVersion = default(string), bool? watch = default(bool?), string pretty = default(string)) + 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.ListNamespacedCustomObjectAsync(group, version, namespaceParameter, plural, labelSelector, resourceVersion, watch, pretty).GetAwaiter().GetResult(); + return operations.ListClusterCustomObjectAsync(group, version, plural, labelSelector, resourceVersion, watch, pretty).GetAwaiter().GetResult(); } /// - /// list or watch namespace scoped custom objects + /// list or watch cluster scoped custom objects /// /// /// The operations group for this extension method. @@ -60612,9 +60615,6 @@ public static VersionInfo GetCode(this IKubernetes operations) /// /// The custom resource's version /// - /// - /// The custom resource's namespace - /// /// /// The custom resource's plural name. For TPRs this would be lowercase plural /// kind. @@ -60641,82 +60641,21 @@ public static VersionInfo GetCode(this IKubernetes operations) /// /// The cancellation token. /// - public static async Task ListNamespacedCustomObjectAsync(this IKubernetes operations, string group, string version, string namespaceParameter, 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.ListNamespacedCustomObjectWithHttpMessagesAsync(group, version, namespaceParameter, plural, labelSelector, resourceVersion, watch, pretty, 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)) + 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.ReplaceClusterCustomObjectWithHttpMessagesAsync(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; } } /// - /// patch the specified cluster scoped custom object + /// replace status of the cluster scoped specified custom object /// /// /// The operations group for this extension method. /// /// - /// The JSON schema of the Resource to patch. /// /// /// the custom resource's group @@ -60725,25 +60664,24 @@ public static object ReplaceClusterCustomObject(this IKubernetes operations, obj /// 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 PatchClusterCustomObject(this IKubernetes operations, object body, string group, string version, string plural, string name) + public static object ReplaceClusterCustomObjectStatus(this IKubernetes operations, object body, string group, string version, string plural, string name) { - return operations.PatchClusterCustomObjectAsync(body, group, version, plural, name).GetAwaiter().GetResult(); + return operations.ReplaceClusterCustomObjectStatusAsync(body, group, version, plural, name).GetAwaiter().GetResult(); } /// - /// patch the specified cluster scoped custom object + /// replace status of the cluster scoped specified custom object /// /// /// The operations group for this extension method. /// /// - /// The JSON schema of the Resource to patch. /// /// /// the custom resource's group @@ -60752,7 +60690,7 @@ public static object PatchClusterCustomObject(this IKubernetes operations, objec /// 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. /// /// @@ -60761,16 +60699,16 @@ public static object PatchClusterCustomObject(this IKubernetes operations, objec /// /// 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 ReplaceClusterCustomObjectStatusAsync(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)) + using (var _result = await operations.ReplaceClusterCustomObjectStatusWithHttpMessagesAsync(body, group, version, plural, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes the specified cluster scoped custom object + /// partially update status of the specified cluster scoped custom object /// /// /// The operations group for this extension method. @@ -60784,38 +60722,19 @@ public static object PatchClusterCustomObject(this IKubernetes operations, objec /// 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 PatchClusterCustomObjectStatus(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.PatchClusterCustomObjectStatusAsync(body, group, version, plural, name).GetAwaiter().GetResult(); } /// - /// Deletes the specified cluster scoped custom object + /// partially update status of the specified cluster scoped custom object /// /// /// The operations group for this extension method. @@ -60829,44 +60748,25 @@ public static object PatchClusterCustomObject(this IKubernetes operations, objec /// 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 PatchClusterCustomObjectStatusAsync(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.PatchClusterCustomObjectStatusWithHttpMessagesAsync(body, group, version, plural, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Returns a cluster scoped custom object + /// read status of the specified cluster scoped custom object /// /// /// The operations group for this extension method. @@ -60878,19 +60778,19 @@ public static object PatchClusterCustomObject(this IKubernetes operations, objec /// 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 GetClusterCustomObjectStatus(this IKubernetes operations, string group, string version, string plural, string name) { - return operations.GetClusterCustomObjectAsync(group, version, plural, name).GetAwaiter().GetResult(); + return operations.GetClusterCustomObjectStatusAsync(group, version, plural, name).GetAwaiter().GetResult(); } /// - /// Returns a cluster scoped custom object + /// read status of the specified cluster scoped custom object /// /// /// The operations group for this extension method. @@ -60902,7 +60802,7 @@ public static object GetClusterCustomObject(this IKubernetes operations, string /// 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 +60811,9 @@ public static object GetClusterCustomObject(this IKubernetes operations, string /// /// 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 GetClusterCustomObjectStatusAsync(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)) + using (var _result = await operations.GetClusterCustomObjectStatusWithHttpMessagesAsync(group, version, plural, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -61213,5 +61113,821 @@ public static object GetNamespacedCustomObject(this IKubernetes operations, stri } } + /// + /// 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 577b05e0..af776079 100644 --- a/src/KubernetesClient/generated/swagger.json +++ b/src/KubernetesClient/generated/swagger.json @@ -64524,7 +64524,7 @@ } } }, - "/apis/{group}/{version}/{plural}": { + "/apis/{group}/{version}/namespaces/{namespace}/{plural}": { "post": { "responses": { "201": { @@ -64540,7 +64540,7 @@ "schemes": [ "https" ], - "description": "Creates a cluster scoped Custom object", + "description": "Creates a namespace scoped Custom object", "parameters": [ { "schema": { @@ -64558,7 +64558,7 @@ "tags": [ "custom_objects" ], - "operationId": "createClusterCustomObject" + "operationId": "createNamespacedCustomObject" }, "parameters": [ { @@ -64582,6 +64582,13 @@ "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, @@ -64605,7 +64612,7 @@ "schemes": [ "https" ], - "description": "list or watch cluster scoped custom objects", + "description": "list or watch namespace scoped custom objects", "parameters": [ { "uniqueItems": true, @@ -64639,10 +64646,10 @@ "consumes": [ "*/*" ], - "operationId": "listClusterCustomObject" + "operationId": "listNamespacedCustomObject" } }, - "/apis/{group}/{version}/namespaces/{namespace}/{plural}": { + "/apis/{group}/{version}/{plural}": { "post": { "responses": { "201": { @@ -64658,7 +64665,7 @@ "schemes": [ "https" ], - "description": "Creates a namespace scoped Custom object", + "description": "Creates a cluster scoped Custom object", "parameters": [ { "schema": { @@ -64676,7 +64683,7 @@ "tags": [ "custom_objects" ], - "operationId": "createNamespacedCustomObject" + "operationId": "createClusterCustomObject" }, "parameters": [ { @@ -64700,13 +64707,6 @@ "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, @@ -64730,7 +64730,7 @@ "schemes": [ "https" ], - "description": "list or watch namespace scoped custom objects", + "description": "list or watch cluster scoped custom objects", "parameters": [ { "uniqueItems": true, @@ -64764,50 +64764,18 @@ "consumes": [ "*/*" ], - "operationId": "listNamespacedCustomObject" + "operationId": "listClusterCustomObject" } }, - "/apis/{group}/{version}/{plural}/{name}": { + "/apis/{group}/{version}/{plural}/{name}/status": { "put": { "responses": { - "200": { - "description": "OK", + "201": { + "description": "Created", "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": { @@ -64821,30 +64789,31 @@ "schemes": [ "https" ], - "description": "patch the specified cluster scoped custom object", + "description": "replace status of the cluster scoped specified 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/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" ], "tags": [ "custom_objects" ], "consumes": [ - "application/merge-patch+json" + "*/*" ], - "operationId": "patchClusterCustomObject" + "operationId": "replaceClusterCustomObjectStatus" }, - "delete": { + "patch": { "responses": { "200": { "description": "OK", @@ -64859,48 +64828,30 @@ "schemes": [ "https" ], - "description": "Deletes the specified cluster scoped custom object", + "description": "partially update status of the specified cluster scoped custom object", "parameters": [ { "schema": { - "$ref": "#/definitions/v1.DeleteOptions" + "type": "object", + "description": "The JSON schema of the Resource to patch." }, "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" + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" ], "tags": [ "custom_objects" ], "consumes": [ - "*/*" + "application/merge-patch+json" ], - "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": {