Skip to content

Commit

Permalink
Merge pull request #1015 from JakobGray/wif-patch
Browse files Browse the repository at this point in the history
Bump version to 0.1.451
  • Loading branch information
renan-campos authored Dec 13, 2024
2 parents c818134 + be9c840 commit b7818cb
Show file tree
Hide file tree
Showing 7 changed files with 18,696 additions and 18,419 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
This document describes the relevant changes between releases of the OCM API
SDK.

## 0.1.451
- Update model version v0.0.404
- Add WifConfig patch endpoint

## 0.1.450
- Update model version v0.0.403
- Add `NodesOutboundConnectivity` in azure_type.model to the `Azure` model
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export PATH := $(LOCAL_BIN_PATH):$(PATH)
export CGO_ENABLED=0

# Details of the model to use:
model_version:=v0.0.403
model_version:=v0.0.404
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
36,901 changes: 18,484 additions & 18,417 deletions clustersmgmt/v1/openapi.go

Large diffs are not rendered by default.

154 changes: 154 additions & 0 deletions clustersmgmt/v1/wif_config_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1

import (
"bufio"
"bytes"
"context"
"io"
"net/http"
Expand Down Expand Up @@ -70,6 +71,16 @@ func (c *WifConfigClient) Get() *WifConfigGetRequest {
}
}

// Update creates a request for the 'update' method.
//
// Updates the WifConfig.
func (c *WifConfigClient) Update() *WifConfigUpdateRequest {
return &WifConfigUpdateRequest{
transport: c.transport,
path: c.path,
}
}

// Status returns the target 'wif_config_status' resource.
func (c *WifConfigClient) Status() *WifConfigStatusClient {
return NewWifConfigStatusClient(
Expand Down Expand Up @@ -443,3 +454,146 @@ func (r *WifConfigGetResponse) GetBody() (value *WifConfig, ok bool) {
}
return
}

// WifConfigUpdateRequest is the request for the 'update' method.
type WifConfigUpdateRequest struct {
transport http.RoundTripper
path string
query url.Values
header http.Header
body *WifConfig
}

// Parameter adds a query parameter.
func (r *WifConfigUpdateRequest) Parameter(name string, value interface{}) *WifConfigUpdateRequest {
helpers.AddValue(&r.query, name, value)
return r
}

// Header adds a request header.
func (r *WifConfigUpdateRequest) Header(name string, value interface{}) *WifConfigUpdateRequest {
helpers.AddHeader(&r.header, name, value)
return r
}

// Impersonate wraps requests on behalf of another user.
// Note: Services that do not support this feature may silently ignore this call.
func (r *WifConfigUpdateRequest) Impersonate(user string) *WifConfigUpdateRequest {
helpers.AddImpersonationHeader(&r.header, user)
return r
}

// Body sets the value of the 'body' parameter.
func (r *WifConfigUpdateRequest) Body(value *WifConfig) *WifConfigUpdateRequest {
r.body = value
return r
}

// Send sends this request, waits for the response, and returns it.
//
// This is a potentially lengthy operation, as it requires network communication.
// Consider using a context and the SendContext method.
func (r *WifConfigUpdateRequest) Send() (result *WifConfigUpdateResponse, err error) {
return r.SendContext(context.Background())
}

// SendContext sends this request, waits for the response, and returns it.
func (r *WifConfigUpdateRequest) SendContext(ctx context.Context) (result *WifConfigUpdateResponse, err error) {
query := helpers.CopyQuery(r.query)
header := helpers.CopyHeader(r.header)
buffer := &bytes.Buffer{}
err = writeWifConfigUpdateRequest(r, buffer)
if err != nil {
return
}
uri := &url.URL{
Path: r.path,
RawQuery: query.Encode(),
}
request := &http.Request{
Method: "PATCH",
URL: uri,
Header: header,
Body: io.NopCloser(buffer),
}
if ctx != nil {
request = request.WithContext(ctx)
}
response, err := r.transport.RoundTrip(request)
if err != nil {
return
}
defer response.Body.Close()
result = &WifConfigUpdateResponse{}
result.status = response.StatusCode
result.header = response.Header
reader := bufio.NewReader(response.Body)
_, err = reader.Peek(1)
if err == io.EOF {
err = nil
return
}
if result.status >= 400 {
result.err, err = errors.UnmarshalErrorStatus(reader, result.status)
if err != nil {
return
}
err = result.err
return
}
err = readWifConfigUpdateResponse(result, reader)
if err != nil {
return
}
return
}

// WifConfigUpdateResponse is the response for the 'update' method.
type WifConfigUpdateResponse struct {
status int
header http.Header
err *errors.Error
body *WifConfig
}

// Status returns the response status code.
func (r *WifConfigUpdateResponse) Status() int {
if r == nil {
return 0
}
return r.status
}

// Header returns header of the response.
func (r *WifConfigUpdateResponse) Header() http.Header {
if r == nil {
return nil
}
return r.header
}

// Error returns the response error.
func (r *WifConfigUpdateResponse) Error() *errors.Error {
if r == nil {
return nil
}
return r.err
}

// Body returns the value of the 'body' parameter.
func (r *WifConfigUpdateResponse) Body() *WifConfig {
if r == nil {
return nil
}
return r.body
}

// GetBody returns the value of the 'body' parameter and
// a flag indicating if the parameter has a value.
func (r *WifConfigUpdateResponse) GetBody() (value *WifConfig, ok bool) {
ok = r != nil && r.body != nil
if ok {
value = r.body
}
return
}
8 changes: 8 additions & 0 deletions clustersmgmt/v1/wif_config_resource_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,11 @@ func readWifConfigGetResponse(response *WifConfigGetResponse, reader io.Reader)
response.body, err = UnmarshalWifConfig(reader)
return err
}
func writeWifConfigUpdateRequest(request *WifConfigUpdateRequest, writer io.Writer) error {
return MarshalWifConfig(request.body, writer)
}
func readWifConfigUpdateResponse(response *WifConfigUpdateResponse, reader io.Reader) error {
var err error
response.body, err = UnmarshalWifConfig(reader)
return err
}
44 changes: 44 additions & 0 deletions openapi/clusters_mgmt/v1/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -10425,6 +10425,50 @@
}
}
}
},
"patch": {
"description": "Updates the WifConfig.",
"parameters": [
{
"name": "wif_config_id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/WifConfig"
}
}
}
},
"responses": {
"200": {
"description": "Success.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/WifConfig"
}
}
}
},
"default": {
"description": "Error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/api/clusters_mgmt/v1/gcp/wif_configs/{wif_config_id}/status": {
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ limitations under the License.

package sdk

const Version = "0.1.450"
const Version = "0.1.451"

0 comments on commit b7818cb

Please sign in to comment.