-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #984 from hunterkepley/ocm-6419
chore: bump ocm-api-model to v0.0.388
- Loading branch information
Showing
34 changed files
with
68,108 additions
and
63,671 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
/* | ||
Copyright (c) 2020 Red Hat, Inc. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// IMPORTANT: This file has been generated automatically, refrain from modifying it manually as all | ||
// your changes will be lost when the file is generated again. | ||
|
||
package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1 | ||
|
||
// OidcThumbprintBuilder contains the data and logic needed to build 'oidc_thumbprint' objects. | ||
// | ||
// Contains the necessary attributes to support oidc configuration thumbprint operations such as fetching/creation of a thumbprint | ||
type OidcThumbprintBuilder struct { | ||
bitmap_ uint32 | ||
href string | ||
clusterId string | ||
kind string | ||
oidcConfigId string | ||
thumbprint string | ||
} | ||
|
||
// NewOidcThumbprint creates a new builder of 'oidc_thumbprint' objects. | ||
func NewOidcThumbprint() *OidcThumbprintBuilder { | ||
return &OidcThumbprintBuilder{} | ||
} | ||
|
||
// Empty returns true if the builder is empty, i.e. no attribute has a value. | ||
func (b *OidcThumbprintBuilder) Empty() bool { | ||
return b == nil || b.bitmap_ == 0 | ||
} | ||
|
||
// HREF sets the value of the 'HREF' attribute to the given value. | ||
func (b *OidcThumbprintBuilder) HREF(value string) *OidcThumbprintBuilder { | ||
b.href = value | ||
b.bitmap_ |= 1 | ||
return b | ||
} | ||
|
||
// ClusterId sets the value of the 'cluster_id' attribute to the given value. | ||
func (b *OidcThumbprintBuilder) ClusterId(value string) *OidcThumbprintBuilder { | ||
b.clusterId = value | ||
b.bitmap_ |= 2 | ||
return b | ||
} | ||
|
||
// Kind sets the value of the 'kind' attribute to the given value. | ||
func (b *OidcThumbprintBuilder) Kind(value string) *OidcThumbprintBuilder { | ||
b.kind = value | ||
b.bitmap_ |= 4 | ||
return b | ||
} | ||
|
||
// OidcConfigId sets the value of the 'oidc_config_id' attribute to the given value. | ||
func (b *OidcThumbprintBuilder) OidcConfigId(value string) *OidcThumbprintBuilder { | ||
b.oidcConfigId = value | ||
b.bitmap_ |= 8 | ||
return b | ||
} | ||
|
||
// Thumbprint sets the value of the 'thumbprint' attribute to the given value. | ||
func (b *OidcThumbprintBuilder) Thumbprint(value string) *OidcThumbprintBuilder { | ||
b.thumbprint = value | ||
b.bitmap_ |= 16 | ||
return b | ||
} | ||
|
||
// Copy copies the attributes of the given object into this builder, discarding any previous values. | ||
func (b *OidcThumbprintBuilder) Copy(object *OidcThumbprint) *OidcThumbprintBuilder { | ||
if object == nil { | ||
return b | ||
} | ||
b.bitmap_ = object.bitmap_ | ||
b.href = object.href | ||
b.clusterId = object.clusterId | ||
b.kind = object.kind | ||
b.oidcConfigId = object.oidcConfigId | ||
b.thumbprint = object.thumbprint | ||
return b | ||
} | ||
|
||
// Build creates a 'oidc_thumbprint' object using the configuration stored in the builder. | ||
func (b *OidcThumbprintBuilder) Build() (object *OidcThumbprint, err error) { | ||
object = new(OidcThumbprint) | ||
object.bitmap_ = b.bitmap_ | ||
object.href = b.href | ||
object.clusterId = b.clusterId | ||
object.kind = b.kind | ||
object.oidcConfigId = b.oidcConfigId | ||
object.thumbprint = b.thumbprint | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,203 @@ | ||
/* | ||
Copyright (c) 2020 Red Hat, Inc. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// IMPORTANT: This file has been generated automatically, refrain from modifying it manually as all | ||
// your changes will be lost when the file is generated again. | ||
|
||
package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1 | ||
|
||
import ( | ||
"bufio" | ||
"bytes" | ||
"context" | ||
"io" | ||
"net/http" | ||
"net/url" | ||
|
||
"github.com/openshift-online/ocm-sdk-go/errors" | ||
"github.com/openshift-online/ocm-sdk-go/helpers" | ||
) | ||
|
||
// OidcThumbprintClient is the client of the 'oidc_thumbprint' resource. | ||
// | ||
// Manages an Oidc Config Thumbprint configuration. | ||
type OidcThumbprintClient struct { | ||
transport http.RoundTripper | ||
path string | ||
} | ||
|
||
// NewOidcThumbprintClient creates a new client for the 'oidc_thumbprint' | ||
// resource using the given transport to send the requests and receive the | ||
// responses. | ||
func NewOidcThumbprintClient(transport http.RoundTripper, path string) *OidcThumbprintClient { | ||
return &OidcThumbprintClient{ | ||
transport: transport, | ||
path: path, | ||
} | ||
} | ||
|
||
// Post creates a request for the 'post' method. | ||
// | ||
// Fetches/creates an OIDC Config Thumbprint from either a cluster ID, or an oidc config ID. | ||
func (c *OidcThumbprintClient) Post() *OidcThumbprintPostRequest { | ||
return &OidcThumbprintPostRequest{ | ||
transport: c.transport, | ||
path: c.path, | ||
} | ||
} | ||
|
||
// OidcThumbprintPostRequest is the request for the 'post' method. | ||
type OidcThumbprintPostRequest struct { | ||
transport http.RoundTripper | ||
path string | ||
query url.Values | ||
header http.Header | ||
body *OidcThumbprintInput | ||
} | ||
|
||
// Parameter adds a query parameter. | ||
func (r *OidcThumbprintPostRequest) Parameter(name string, value interface{}) *OidcThumbprintPostRequest { | ||
helpers.AddValue(&r.query, name, value) | ||
return r | ||
} | ||
|
||
// Header adds a request header. | ||
func (r *OidcThumbprintPostRequest) Header(name string, value interface{}) *OidcThumbprintPostRequest { | ||
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 *OidcThumbprintPostRequest) Impersonate(user string) *OidcThumbprintPostRequest { | ||
helpers.AddImpersonationHeader(&r.header, user) | ||
return r | ||
} | ||
|
||
// Body sets the value of the 'body' parameter. | ||
func (r *OidcThumbprintPostRequest) Body(value *OidcThumbprintInput) *OidcThumbprintPostRequest { | ||
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 *OidcThumbprintPostRequest) Send() (result *OidcThumbprintPostResponse, err error) { | ||
return r.SendContext(context.Background()) | ||
} | ||
|
||
// SendContext sends this request, waits for the response, and returns it. | ||
func (r *OidcThumbprintPostRequest) SendContext(ctx context.Context) (result *OidcThumbprintPostResponse, err error) { | ||
query := helpers.CopyQuery(r.query) | ||
header := helpers.CopyHeader(r.header) | ||
buffer := &bytes.Buffer{} | ||
err = writeOidcThumbprintPostRequest(r, buffer) | ||
if err != nil { | ||
return | ||
} | ||
uri := &url.URL{ | ||
Path: r.path, | ||
RawQuery: query.Encode(), | ||
} | ||
request := &http.Request{ | ||
Method: "POST", | ||
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 = &OidcThumbprintPostResponse{} | ||
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 = readOidcThumbprintPostResponse(result, reader) | ||
if err != nil { | ||
return | ||
} | ||
return | ||
} | ||
|
||
// OidcThumbprintPostResponse is the response for the 'post' method. | ||
type OidcThumbprintPostResponse struct { | ||
status int | ||
header http.Header | ||
err *errors.Error | ||
body *OidcThumbprint | ||
} | ||
|
||
// Status returns the response status code. | ||
func (r *OidcThumbprintPostResponse) Status() int { | ||
if r == nil { | ||
return 0 | ||
} | ||
return r.status | ||
} | ||
|
||
// Header returns header of the response. | ||
func (r *OidcThumbprintPostResponse) Header() http.Header { | ||
if r == nil { | ||
return nil | ||
} | ||
return r.header | ||
} | ||
|
||
// Error returns the response error. | ||
func (r *OidcThumbprintPostResponse) Error() *errors.Error { | ||
if r == nil { | ||
return nil | ||
} | ||
return r.err | ||
} | ||
|
||
// Body returns the value of the 'body' parameter. | ||
func (r *OidcThumbprintPostResponse) Body() *OidcThumbprint { | ||
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 *OidcThumbprintPostResponse) GetBody() (value *OidcThumbprint, ok bool) { | ||
ok = r != nil && r.body != nil | ||
if ok { | ||
value = r.body | ||
} | ||
return | ||
} |
Oops, something went wrong.