Skip to content

Commit

Permalink
Merge pull request #822 from Lir10/release_0_1_363
Browse files Browse the repository at this point in the history
chore: release v0.1.363
  • Loading branch information
tzvatot authored Aug 17, 2023
2 parents b090071 + 0ae4021 commit 3bf771c
Show file tree
Hide file tree
Showing 8 changed files with 535 additions and 471 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
This document describes the relevant changes between releases of the OCM API
SDK.

## 0.1.363
- Modify SelfAccessReview to return IsOCMInternal field

## 0.1.362
- Redact aws access and secret access keys from debug logs

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
export CGO_ENABLED=0

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

# Details of the metamodel to use:
Expand Down
862 changes: 436 additions & 426 deletions authorizations/v1/openapi.go

Large diffs are not rendered by default.

18 changes: 14 additions & 4 deletions authorizations/v1/self_access_review_response_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type SelfAccessReviewResponseBuilder struct {
resourceType string
subscriptionID string
allowed bool
isOCMInternal bool
}

// NewSelfAccessReviewResponse creates a new builder of 'self_access_review_response' objects.
Expand Down Expand Up @@ -72,31 +73,38 @@ func (b *SelfAccessReviewResponseBuilder) ClusterUUID(value string) *SelfAccessR
return b
}

// IsOCMInternal sets the value of the 'is_OCM_internal' attribute to the given value.
func (b *SelfAccessReviewResponseBuilder) IsOCMInternal(value bool) *SelfAccessReviewResponseBuilder {
b.isOCMInternal = value
b.bitmap_ |= 16
return b
}

// OrganizationID sets the value of the 'organization_ID' attribute to the given value.
func (b *SelfAccessReviewResponseBuilder) OrganizationID(value string) *SelfAccessReviewResponseBuilder {
b.organizationID = value
b.bitmap_ |= 16
b.bitmap_ |= 32
return b
}

// Reason sets the value of the 'reason' attribute to the given value.
func (b *SelfAccessReviewResponseBuilder) Reason(value string) *SelfAccessReviewResponseBuilder {
b.reason = value
b.bitmap_ |= 32
b.bitmap_ |= 64
return b
}

// ResourceType sets the value of the 'resource_type' attribute to the given value.
func (b *SelfAccessReviewResponseBuilder) ResourceType(value string) *SelfAccessReviewResponseBuilder {
b.resourceType = value
b.bitmap_ |= 64
b.bitmap_ |= 128
return b
}

// SubscriptionID sets the value of the 'subscription_ID' attribute to the given value.
func (b *SelfAccessReviewResponseBuilder) SubscriptionID(value string) *SelfAccessReviewResponseBuilder {
b.subscriptionID = value
b.bitmap_ |= 128
b.bitmap_ |= 256
return b
}

Expand All @@ -110,6 +118,7 @@ func (b *SelfAccessReviewResponseBuilder) Copy(object *SelfAccessReviewResponse)
b.allowed = object.allowed
b.clusterID = object.clusterID
b.clusterUUID = object.clusterUUID
b.isOCMInternal = object.isOCMInternal
b.organizationID = object.organizationID
b.reason = object.reason
b.resourceType = object.resourceType
Expand All @@ -125,6 +134,7 @@ func (b *SelfAccessReviewResponseBuilder) Build() (object *SelfAccessReviewRespo
object.allowed = b.allowed
object.clusterID = b.clusterID
object.clusterUUID = b.clusterUUID
object.isOCMInternal = b.isOCMInternal
object.organizationID = b.organizationID
object.reason = b.reason
object.resourceType = b.resourceType
Expand Down
72 changes: 48 additions & 24 deletions authorizations/v1/self_access_review_response_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type SelfAccessReviewResponse struct {
resourceType string
subscriptionID string
allowed bool
isOCMInternal bool
}

// Empty returns true if the object is empty, i.e. no attribute has a value.
Expand All @@ -42,7 +43,7 @@ func (o *SelfAccessReviewResponse) Empty() bool {
// Action returns the value of the 'action' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Indicates the action, one of: [get,list,create,delete,update]
// Indicates the action, one of: [get,list,create,delete,update].
func (o *SelfAccessReviewResponse) Action() string {
if o != nil && o.bitmap_&1 != 0 {
return o.action
Expand All @@ -53,7 +54,7 @@ func (o *SelfAccessReviewResponse) Action() string {
// GetAction returns the value of the 'action' attribute and
// a flag indicating if the attribute has a value.
//
// Indicates the action, one of: [get,list,create,delete,update]
// Indicates the action, one of: [get,list,create,delete,update].
func (o *SelfAccessReviewResponse) GetAction() (value string, ok bool) {
ok = o != nil && o.bitmap_&1 != 0
if ok {
Expand All @@ -65,7 +66,7 @@ func (o *SelfAccessReviewResponse) GetAction() (value string, ok bool) {
// Allowed returns the value of the 'allowed' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Defines whether the action on the specified resource type is allowed
// Defines whether the action on the specified resource type is allowed.
func (o *SelfAccessReviewResponse) Allowed() bool {
if o != nil && o.bitmap_&2 != 0 {
return o.allowed
Expand All @@ -76,7 +77,7 @@ func (o *SelfAccessReviewResponse) Allowed() bool {
// GetAllowed returns the value of the 'allowed' attribute and
// a flag indicating if the attribute has a value.
//
// Defines whether the action on the specified resource type is allowed
// Defines whether the action on the specified resource type is allowed.
func (o *SelfAccessReviewResponse) GetAllowed() (value bool, ok bool) {
ok = o != nil && o.bitmap_&2 != 0
if ok {
Expand All @@ -88,7 +89,7 @@ func (o *SelfAccessReviewResponse) GetAllowed() (value bool, ok bool) {
// ClusterID returns the value of the 'cluster_ID' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Indicates which Cluster (internal id) the resource type belongs to
// Indicates which Cluster (internal id) the resource type belongs to.
func (o *SelfAccessReviewResponse) ClusterID() string {
if o != nil && o.bitmap_&4 != 0 {
return o.clusterID
Expand All @@ -99,7 +100,7 @@ func (o *SelfAccessReviewResponse) ClusterID() string {
// GetClusterID returns the value of the 'cluster_ID' attribute and
// a flag indicating if the attribute has a value.
//
// Indicates which Cluster (internal id) the resource type belongs to
// Indicates which Cluster (internal id) the resource type belongs to.
func (o *SelfAccessReviewResponse) GetClusterID() (value string, ok bool) {
ok = o != nil && o.bitmap_&4 != 0
if ok {
Expand All @@ -111,7 +112,7 @@ func (o *SelfAccessReviewResponse) GetClusterID() (value string, ok bool) {
// ClusterUUID returns the value of the 'cluster_UUID' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Indicates which Cluster (external id) the resource type belongs to
// Indicates which Cluster (external id) the resource type belongs to.
func (o *SelfAccessReviewResponse) ClusterUUID() string {
if o != nil && o.bitmap_&8 != 0 {
return o.clusterUUID
Expand All @@ -122,7 +123,7 @@ func (o *SelfAccessReviewResponse) ClusterUUID() string {
// GetClusterUUID returns the value of the 'cluster_UUID' attribute and
// a flag indicating if the attribute has a value.
//
// Indicates which Cluster (external id) the resource type belongs to
// Indicates which Cluster (external id) the resource type belongs to.
func (o *SelfAccessReviewResponse) GetClusterUUID() (value string, ok bool) {
ok = o != nil && o.bitmap_&8 != 0
if ok {
Expand All @@ -131,12 +132,35 @@ func (o *SelfAccessReviewResponse) GetClusterUUID() (value string, ok bool) {
return
}

// IsOCMInternal returns the value of the 'is_OCM_internal' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Defines whether an account is ocm internal.
func (o *SelfAccessReviewResponse) IsOCMInternal() bool {
if o != nil && o.bitmap_&16 != 0 {
return o.isOCMInternal
}
return false
}

// GetIsOCMInternal returns the value of the 'is_OCM_internal' attribute and
// a flag indicating if the attribute has a value.
//
// Defines whether an account is ocm internal.
func (o *SelfAccessReviewResponse) GetIsOCMInternal() (value bool, ok bool) {
ok = o != nil && o.bitmap_&16 != 0
if ok {
value = o.isOCMInternal
}
return
}

// OrganizationID returns the value of the 'organization_ID' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Indicates which Organization the resource type belongs to
// Indicates which Organization the resource type belongs to.
func (o *SelfAccessReviewResponse) OrganizationID() string {
if o != nil && o.bitmap_&16 != 0 {
if o != nil && o.bitmap_&32 != 0 {
return o.organizationID
}
return ""
Expand All @@ -145,9 +169,9 @@ func (o *SelfAccessReviewResponse) OrganizationID() string {
// GetOrganizationID returns the value of the 'organization_ID' attribute and
// a flag indicating if the attribute has a value.
//
// Indicates which Organization the resource type belongs to
// Indicates which Organization the resource type belongs to.
func (o *SelfAccessReviewResponse) GetOrganizationID() (value string, ok bool) {
ok = o != nil && o.bitmap_&16 != 0
ok = o != nil && o.bitmap_&32 != 0
if ok {
value = o.organizationID
}
Expand All @@ -157,9 +181,9 @@ func (o *SelfAccessReviewResponse) GetOrganizationID() (value string, ok bool) {
// Reason returns the value of the 'reason' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Defines further context for the value in allowed (if applicable)
// Defines further context for the value in allowed (if applicable).
func (o *SelfAccessReviewResponse) Reason() string {
if o != nil && o.bitmap_&32 != 0 {
if o != nil && o.bitmap_&64 != 0 {
return o.reason
}
return ""
Expand All @@ -168,9 +192,9 @@ func (o *SelfAccessReviewResponse) Reason() string {
// GetReason returns the value of the 'reason' attribute and
// a flag indicating if the attribute has a value.
//
// Defines further context for the value in allowed (if applicable)
// Defines further context for the value in allowed (if applicable).
func (o *SelfAccessReviewResponse) GetReason() (value string, ok bool) {
ok = o != nil && o.bitmap_&32 != 0
ok = o != nil && o.bitmap_&64 != 0
if ok {
value = o.reason
}
Expand All @@ -181,9 +205,9 @@ func (o *SelfAccessReviewResponse) GetReason() (value string, ok bool) {
// the zero value of the type if the attribute doesn't have a value.
//
// Indicates the type of the resource an action would be taken on.
// See uhc-account-manager/openapi/openapi.yaml for a list of possible values
// See uhc-account-manager/openapi/openapi.yaml for a list of possible values.
func (o *SelfAccessReviewResponse) ResourceType() string {
if o != nil && o.bitmap_&64 != 0 {
if o != nil && o.bitmap_&128 != 0 {
return o.resourceType
}
return ""
Expand All @@ -193,9 +217,9 @@ func (o *SelfAccessReviewResponse) ResourceType() string {
// a flag indicating if the attribute has a value.
//
// Indicates the type of the resource an action would be taken on.
// See uhc-account-manager/openapi/openapi.yaml for a list of possible values
// See uhc-account-manager/openapi/openapi.yaml for a list of possible values.
func (o *SelfAccessReviewResponse) GetResourceType() (value string, ok bool) {
ok = o != nil && o.bitmap_&64 != 0
ok = o != nil && o.bitmap_&128 != 0
if ok {
value = o.resourceType
}
Expand All @@ -205,9 +229,9 @@ func (o *SelfAccessReviewResponse) GetResourceType() (value string, ok bool) {
// SubscriptionID returns the value of the 'subscription_ID' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Indicates which Subscription the resource type belongs to
// Indicates which Subscription the resource type belongs to.
func (o *SelfAccessReviewResponse) SubscriptionID() string {
if o != nil && o.bitmap_&128 != 0 {
if o != nil && o.bitmap_&256 != 0 {
return o.subscriptionID
}
return ""
Expand All @@ -216,9 +240,9 @@ func (o *SelfAccessReviewResponse) SubscriptionID() string {
// GetSubscriptionID returns the value of the 'subscription_ID' attribute and
// a flag indicating if the attribute has a value.
//
// Indicates which Subscription the resource type belongs to
// Indicates which Subscription the resource type belongs to.
func (o *SelfAccessReviewResponse) GetSubscriptionID() (value string, ok bool) {
ok = o != nil && o.bitmap_&128 != 0
ok = o != nil && o.bitmap_&256 != 0
if ok {
value = o.subscriptionID
}
Expand Down
27 changes: 20 additions & 7 deletions authorizations/v1/self_access_review_response_type_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ func writeSelfAccessReviewResponse(object *SelfAccessReviewResponse, stream *jso
count++
}
present_ = object.bitmap_&16 != 0
if present_ {
if count > 0 {
stream.WriteMore()
}
stream.WriteObjectField("is_ocm_internal")
stream.WriteBool(object.isOCMInternal)
count++
}
present_ = object.bitmap_&32 != 0
if present_ {
if count > 0 {
stream.WriteMore()
Expand All @@ -87,7 +96,7 @@ func writeSelfAccessReviewResponse(object *SelfAccessReviewResponse, stream *jso
stream.WriteString(object.organizationID)
count++
}
present_ = object.bitmap_&32 != 0
present_ = object.bitmap_&64 != 0
if present_ {
if count > 0 {
stream.WriteMore()
Expand All @@ -96,7 +105,7 @@ func writeSelfAccessReviewResponse(object *SelfAccessReviewResponse, stream *jso
stream.WriteString(object.reason)
count++
}
present_ = object.bitmap_&64 != 0
present_ = object.bitmap_&128 != 0
if present_ {
if count > 0 {
stream.WriteMore()
Expand All @@ -105,7 +114,7 @@ func writeSelfAccessReviewResponse(object *SelfAccessReviewResponse, stream *jso
stream.WriteString(object.resourceType)
count++
}
present_ = object.bitmap_&128 != 0
present_ = object.bitmap_&256 != 0
if present_ {
if count > 0 {
stream.WriteMore()
Expand Down Expand Up @@ -153,22 +162,26 @@ func readSelfAccessReviewResponse(iterator *jsoniter.Iterator) *SelfAccessReview
value := iterator.ReadString()
object.clusterUUID = value
object.bitmap_ |= 8
case "is_ocm_internal":
value := iterator.ReadBool()
object.isOCMInternal = value
object.bitmap_ |= 16
case "organization_id":
value := iterator.ReadString()
object.organizationID = value
object.bitmap_ |= 16
object.bitmap_ |= 32
case "reason":
value := iterator.ReadString()
object.reason = value
object.bitmap_ |= 32
object.bitmap_ |= 64
case "resource_type":
value := iterator.ReadString()
object.resourceType = value
object.bitmap_ |= 64
object.bitmap_ |= 128
case "subscription_id":
value := iterator.ReadString()
object.subscriptionID = value
object.bitmap_ |= 128
object.bitmap_ |= 256
default:
iterator.ReadAny()
}
Expand Down
Loading

0 comments on commit 3bf771c

Please sign in to comment.