diff --git a/iam/application__azgen.go b/iam/application__azgen.go index a022134..8fc1d41 100644 --- a/iam/application__azgen.go +++ b/iam/application__azgen.go @@ -59,10 +59,9 @@ var _ azid.TextUnmarshalable = &_ApplicationIDZeroVar var _ azcore.EntityID[ApplicationIDNum] = _ApplicationIDZero var _ azcore.ValueObjectAssert[ApplicationID] = _ApplicationIDZero -const _ApplicationIDZero = - ApplicationID(ApplicationIDNumZero) -var _ApplicationIDZeroVar = - _ApplicationIDZero +const _ApplicationIDZero = ApplicationID(ApplicationIDNumZero) + +var _ApplicationIDZeroVar = _ApplicationIDZero // ApplicationIDZero returns // a zero-valued instance of ApplicationID. @@ -141,7 +140,7 @@ func (id ApplicationID) EqualsApplicationID( } func (id ApplicationID) AZIDBin() []byte { - b := make([]byte, 4 + 1) + b := make([]byte, 4+1) b[0] = ApplicationIDNumBinDataType.Byte() binary.BigEndian.PutUint32(b[1:], uint32(id)) return b @@ -318,18 +317,15 @@ var _ azcore.ValueObjectAssert[ApplicationIDNum] = ApplicationIDNumZero // ApplicationIDNumIdentifierBitsMask is used to // extract identifier bits from an instance of ApplicationIDNum. -const ApplicationIDNumIdentifierBitsMask uint32 = - 0b_00000011_11111111_11111111_11111111 +const ApplicationIDNumIdentifierBitsMask uint32 = 0b_00000011_11111111_11111111_11111111 // ApplicationIDNumZero is the zero value // for ApplicationIDNum. -const ApplicationIDNumZero = - ApplicationIDNum(0) +const ApplicationIDNumZero = ApplicationIDNum(0) // _ApplicationIDNumZeroVar is used for testing // pointer-based interfaces conformance. -var _ApplicationIDNumZeroVar = - ApplicationIDNumZero +var _ApplicationIDNumZeroVar = ApplicationIDNumZero // ApplicationIDNumFromPrimitiveValue creates an instance // of ApplicationIDNum from its primitive value. @@ -383,7 +379,7 @@ func (idNum ApplicationIDNum) IsZero() bool { // valid, but it's considered invalid because it's a fake. func (idNum ApplicationIDNum) IsStaticallyValid() bool { return int32(idNum) > 0 && - (uint32(idNum) & ApplicationIDNumIdentifierBitsMask) != 0 + (uint32(idNum)&ApplicationIDNumIdentifierBitsMask) != 0 } // IsNotStaticallyValid returns the negation of value returned by IsStaticallyValid. @@ -443,15 +439,14 @@ func (idNum *ApplicationIDNum) UnmarshalAZIDBinField( const ( ApplicationIDNumEmbeddedFieldsMask = 0b_01110000_00000000_00000000_00000000 - - ApplicationIDNumFirstPartyMask = 0b_01000000_00000000_00000000_00000000 - ApplicationIDNumFirstPartyBits = 0b_01000000_00000000_00000000_00000000 - ApplicationIDNumServiceMask = 0b_00100000_00000000_00000000_00000000 - ApplicationIDNumServiceBits = 0b_00000000_00000000_00000000_00000000 - ApplicationIDNumUserAgentMask = 0b_00100000_00000000_00000000_00000000 - ApplicationIDNumUserAgentBits = 0b_00100000_00000000_00000000_00000000 - ApplicationIDNumUserAgentAuthorizationPublicMask = 0b_00110000_00000000_00000000_00000000 - ApplicationIDNumUserAgentAuthorizationPublicBits = 0b_00100000_00000000_00000000_00000000 + ApplicationIDNumFirstPartyMask = 0b_01000000_00000000_00000000_00000000 + ApplicationIDNumFirstPartyBits = 0b_01000000_00000000_00000000_00000000 + ApplicationIDNumServiceMask = 0b_00100000_00000000_00000000_00000000 + ApplicationIDNumServiceBits = 0b_00000000_00000000_00000000_00000000 + ApplicationIDNumUserAgentMask = 0b_00100000_00000000_00000000_00000000 + ApplicationIDNumUserAgentBits = 0b_00100000_00000000_00000000_00000000 + ApplicationIDNumUserAgentAuthorizationPublicMask = 0b_00110000_00000000_00000000_00000000 + ApplicationIDNumUserAgentAuthorizationPublicBits = 0b_00100000_00000000_00000000_00000000 ApplicationIDNumUserAgentAuthorizationConfidentialMask = 0b_00110000_00000000_00000000_00000000 ApplicationIDNumUserAgentAuthorizationConfidentialBits = 0b_00110000_00000000_00000000_00000000 ) @@ -589,11 +584,11 @@ func (idNum ApplicationIDNum) HasUserAgentAuthorizationConfidentialBits() bool { // entity's built-in attributes. type ApplicationAttrSet struct { // AZxEntityAttrSetBase - - displayName string - secret string - platformType string - requiredScopes []string + + displayName string + secret string + platformType string + requiredScopes []string oAuth2RedirectURI []string } @@ -607,10 +602,10 @@ func NewApplicationAttrSet( oAuth2RedirectURI []string, ) ApplicationAttrSet { return ApplicationAttrSet{ - displayName: displayName, - secret: secret, - platformType: platformType, - requiredScopes: slices.Clone(requiredScopes), + displayName: displayName, + secret: secret, + platformType: platformType, + requiredScopes: slices.Clone(requiredScopes), oAuth2RedirectURI: slices.Clone(oAuth2RedirectURI), } } @@ -620,10 +615,10 @@ var _ azcore.ValueObjectAssert[ApplicationAttrSet] = ApplicationAttrSet{} // Clone returns a copy of ApplicationAttrSet func (attrs ApplicationAttrSet) Clone() ApplicationAttrSet { return ApplicationAttrSet{ - displayName: attrs.displayName, - secret: attrs.secret, - platformType: attrs.platformType, - requiredScopes: slices.Clone(attrs.requiredScopes), + displayName: attrs.displayName, + secret: attrs.secret, + platformType: attrs.platformType, + requiredScopes: slices.Clone(attrs.requiredScopes), oAuth2RedirectURI: slices.Clone(attrs.oAuth2RedirectURI), } } @@ -640,10 +635,10 @@ func (attrs ApplicationAttrSet) WithDisplayName( displayName string, ) ApplicationAttrSet { return ApplicationAttrSet{ - displayName: displayName, - secret: attrs.secret, - platformType: attrs.platformType, - requiredScopes: slices.Clone(attrs.requiredScopes), + displayName: displayName, + secret: attrs.secret, + platformType: attrs.platformType, + requiredScopes: slices.Clone(attrs.requiredScopes), oAuth2RedirectURI: slices.Clone(attrs.oAuth2RedirectURI), } } @@ -660,10 +655,10 @@ func (attrs ApplicationAttrSet) WithSecret( secret string, ) ApplicationAttrSet { return ApplicationAttrSet{ - displayName: attrs.displayName, - secret: secret, - platformType: attrs.platformType, - requiredScopes: slices.Clone(attrs.requiredScopes), + displayName: attrs.displayName, + secret: secret, + platformType: attrs.platformType, + requiredScopes: slices.Clone(attrs.requiredScopes), oAuth2RedirectURI: slices.Clone(attrs.oAuth2RedirectURI), } } @@ -680,10 +675,10 @@ func (attrs ApplicationAttrSet) WithPlatformType( platformType string, ) ApplicationAttrSet { return ApplicationAttrSet{ - displayName: attrs.displayName, - secret: attrs.secret, - platformType: platformType, - requiredScopes: slices.Clone(attrs.requiredScopes), + displayName: attrs.displayName, + secret: attrs.secret, + platformType: platformType, + requiredScopes: slices.Clone(attrs.requiredScopes), oAuth2RedirectURI: slices.Clone(attrs.oAuth2RedirectURI), } } @@ -700,10 +695,10 @@ func (attrs ApplicationAttrSet) WithRequiredScopes( requiredScopes []string, ) ApplicationAttrSet { return ApplicationAttrSet{ - displayName: attrs.displayName, - secret: attrs.secret, - platformType: attrs.platformType, - requiredScopes: slices.Clone(requiredScopes), + displayName: attrs.displayName, + secret: attrs.secret, + platformType: attrs.platformType, + requiredScopes: slices.Clone(requiredScopes), oAuth2RedirectURI: slices.Clone(attrs.oAuth2RedirectURI), } } @@ -720,10 +715,10 @@ func (attrs ApplicationAttrSet) WithOAuth2RedirectURI( oAuth2RedirectURI []string, ) ApplicationAttrSet { return ApplicationAttrSet{ - displayName: attrs.displayName, - secret: attrs.secret, - platformType: attrs.platformType, - requiredScopes: slices.Clone(attrs.requiredScopes), + displayName: attrs.displayName, + secret: attrs.secret, + platformType: attrs.platformType, + requiredScopes: slices.Clone(attrs.requiredScopes), oAuth2RedirectURI: slices.Clone(oAuth2RedirectURI), } } @@ -765,7 +760,7 @@ type ApplicationInstanceService interface { // provides access to instances metadata. type ApplicationInstanceStateService interface { // GetApplicationInstanceState checks if the provided - // ref-key is valid and whether the instance is deleted. + // ref-key is valid and whether the instance is deleted. // // This method returns nil if the id is not referencing to any valid // instance. @@ -778,19 +773,17 @@ type ApplicationInstanceStateService interface { // ApplicationInstanceState holds information about // an instance of Application. type ApplicationInstanceState struct { - RevisionNumber_ int32 + RevisionNumber_ int32 - // Deletion_ holds information about the deletion of the instance. If - // the instance has not been deleted, this field value will be nil. + // Deletion_ holds information about the deletion of the instance. If + // the instance has not been deleted, this field value will be nil. Deletion_ *ApplicationDeletionState } var _ azcore.EntityInstanceInfo[ int32, ApplicationDeletionState, ] = ApplicationInstanceState{} -var _ azcore.ValueObjectAssert[ - ApplicationDeletionState, -] = ApplicationDeletionState{} +var _ azcore.ValueObjectAssert[ApplicationDeletionState] = ApplicationDeletionState{} // ApplicationInstanceStateZero returns an instance of // ApplicationInstanceState with attributes set their respective zero @@ -817,9 +810,9 @@ func (instInfo ApplicationInstanceState) Deletion() *ApplicationDeletionState { // IsActive returns true if the instance is considered as active. func (instInfo ApplicationInstanceState) IsActive() bool { - // Note: we will check other flags in the future, but that's said, - // deleted instance is considered inactive. - return !instInfo.IsDeleted() + // Note: we will check other flags in the future, but that's said, + // deleted instance is considered inactive. + return !instInfo.IsDeleted() } // IsDeleted returns true if the instance was deleted. @@ -835,13 +828,11 @@ func (instInfo ApplicationInstanceState) IsDeleted() bool { // ApplicationDeletionState holds information about // the deletion of an instance if the instance has been deleted. type ApplicationDeletionState struct { - Deleted_ bool + Deleted_ bool } var _ azcore.EntityDeletionInfo = ApplicationDeletionState{} -var _ azcore.ValueObjectAssert[ - ApplicationDeletionState, -] = ApplicationDeletionState{} +var _ azcore.ValueObjectAssert[ApplicationDeletionState] = ApplicationDeletionState{} func (instDelInfo ApplicationDeletionState) Clone() ApplicationDeletionState { // Already a copy and there's no shared underlying data instance @@ -862,7 +853,7 @@ type ApplicationInstanceServiceInternal interface { CreateApplicationInternal( ctx context.Context, input ApplicationCreationParams, - ) (id ApplicationID, initialState ApplicationInstanceState, err error); + ) (id ApplicationID, initialState ApplicationInstanceState, err error) // DeleteApplicationInternal deletes an instance of // Application entity based identfied by idOfInstToDel. @@ -897,7 +888,9 @@ type ApplicationDeletionParams struct { type ApplicationService interface { // AZxEntityService + ApplicationIDService ApplicationInstanceService + ApplicationInstanceStateService } // ApplicationServiceClient is the interface for diff --git a/iam/callmetadata.go b/iam/callmetadata.go index f51420a..18ffd45 100644 --- a/iam/callmetadata.go +++ b/iam/callmetadata.go @@ -12,6 +12,7 @@ var ( ErrCallMetadataContextNotFound = errors.CtxM("context has no call metadata") ) +// CallMetadataKey is the key used to set and get CallMetadat from contexts. const CallMetadataKey = contextKey("CallMetadata") // CallMetadata holds metadata about a service method call. @@ -19,17 +20,27 @@ type CallMetadata struct { contextErr error authorization *Authorization - // ReceiveTime returns the time when request was accepted by - // the handler. receiveTime time.Time } +// ContextError returns non-nil when there was an error when loading +// CallMetadata from the context. func (md CallMetadata) ContextError() error { return md.contextErr } +// Authorization returns the authorization information loaded from +// the request. +// +// In HTTP requests, authorization information is loaded from their +// Authorization, X-Api-Key, and authorization-related headers. +// +// In gRPC requests, authorization information is loaded from their +// metadata. func (md CallMetadata) Authorization() *Authorization { return md.authorization } +// ReceiveTime returns the time when request was accepted by +// the handler. func (md CallMetadata) ReceiveTime() time.Time { return md.receiveTime } // CallMetadataOf extracts CallMetadata from ctx. diff --git a/iam/service__azgen.go b/iam/service__azgen.go new file mode 100644 index 0000000..dc42206 --- /dev/null +++ b/iam/service__azgen.go @@ -0,0 +1,6 @@ +package iam + +type Service interface { + UserService() UserService + ApplicationService() ApplicationService +} diff --git a/iam/session__azgen.go b/iam/session__azgen.go index afdcaa4..d34ec78 100644 --- a/iam/session__azgen.go +++ b/iam/session__azgen.go @@ -46,7 +46,7 @@ var _ = strings.Compare // an instance of adjunct entity Session system-wide. type SessionID struct { terminal TerminalID - idNum SessionIDNum + idNum SessionIDNum } // The total number of fields in the struct. @@ -56,11 +56,11 @@ const _SessionIDFieldCount = 1 + 1 // of SessionID with the provided attribute values. func NewSessionID( terminal TerminalID, - idNum SessionIDNum, + idNum SessionIDNum, ) SessionID { return SessionID{ terminal: terminal, - idNum: idNum, + idNum: idNum, } } @@ -75,7 +75,7 @@ var _ azcore.SessionID[SessionIDNum] = _SessionIDZero var _SessionIDZero = SessionID{ terminal: TerminalIDZero(), - idNum: SessionIDNumZero, + idNum: SessionIDNumZero, } // SessionIDZero returns @@ -265,7 +265,7 @@ func SessionIDFromAZIDBinField( return SessionID{ terminal: terminalID, - idNum: idNum, + idNum: idNum, }, dataCursor, nil } @@ -385,7 +385,7 @@ func (id SessionID) WithTerminal( ) SessionID { return SessionID{ terminal: terminal, - idNum: id.idNum, + idNum: id.idNum, } } @@ -412,17 +412,14 @@ var _ azcore.SessionIDNumMethods = SessionIDNumZero // SessionIDNumIdentifierBitsMask is used to // extract identifier bits from an instance of SessionIDNum. -const SessionIDNumIdentifierBitsMask uint32 = - 0b_00000000_11111111_11111111_11111111 +const SessionIDNumIdentifierBitsMask uint32 = 0b_00000000_11111111_11111111_11111111 // SessionIDNumZero is the zero value for SessionIDNum. -const SessionIDNumZero = - SessionIDNum(0) +const SessionIDNumZero = SessionIDNum(0) // _SessionIDNumZeroVar is used for testing // pointer-based interfaces conformance. -var _SessionIDNumZeroVar = - SessionIDNumZero +var _SessionIDNumZeroVar = SessionIDNumZero // SessionIDNumFromPrimitiveValue creates an instance // of SessionIDNum from its primitive value. @@ -462,7 +459,7 @@ func (idNum SessionIDNum) IsZero() bool { // a valid instance of Session. func (idNum SessionIDNum) IsStaticallyValid() bool { return int32(idNum) > 0 && - (uint32(idNum) & SessionIDNumIdentifierBitsMask) != 0 + (uint32(idNum)&SessionIDNumIdentifierBitsMask) != 0 } // IsNotStaticallyValid returns the negation of value returned by IsStaticallyValid. @@ -521,8 +518,6 @@ func (idNum *SessionIDNum) UnmarshalAZIDBinField( // Embedded fields const ( SessionIDNumEmbeddedFieldsMask = 0b_00000000_00000000_00000000_00000000 - - ) //endregion @@ -533,23 +528,20 @@ const ( // attributes for adjunct Session. type SessionAttributes struct { // AZxAdjunctEntityAttrSetBase - + } // NewSessionAttributes returns a new instance // of SessionAttributes with the provided attribute values. -func NewSessionAttributes( -) SessionAttributes { - return SessionAttributes{ - } +func NewSessionAttributes() SessionAttributes { + return SessionAttributes{} } var _ azcore.ValueObjectAssert[SessionAttributes] = SessionAttributes{} // Clone returns a copy of SessionAttributes func (attrs SessionAttributes) Clone() SessionAttributes { - return SessionAttributes{ - } + return SessionAttributes{} } func (attrs SessionAttributes) Equals( @@ -584,7 +576,7 @@ type SessionInstanceService interface { // provides access to instances metadata. type SessionInstanceStateService interface { // GetSessionInstanceState checks if the provided - // ref-key is valid and whether the instance is deleted. + // ref-key is valid and whether the instance is deleted. // // This method returns nil if the id is not referencing to any valid // instance. @@ -597,19 +589,17 @@ type SessionInstanceStateService interface { // SessionInstanceState holds information about // an instance of Session. type SessionInstanceState struct { - RevisionNumber_ int32 + RevisionNumber_ int32 - // Deletion_ holds information about the deletion of the instance. If - // the instance has not been deleted, this field value will be nil. + // Deletion_ holds information about the deletion of the instance. If + // the instance has not been deleted, this field value will be nil. Deletion_ *SessionDeletionState } var _ azcore.EntityInstanceInfo[ int32, SessionDeletionState, ] = SessionInstanceState{} -var _ azcore.ValueObjectAssert[ - SessionDeletionState, -] = SessionDeletionState{} +var _ azcore.ValueObjectAssert[SessionDeletionState] = SessionDeletionState{} // SessionInstanceStateZero returns an instance of // SessionInstanceState with attributes set their respective zero @@ -636,9 +626,9 @@ func (instInfo SessionInstanceState) Deletion() *SessionDeletionState { // IsActive returns true if the instance is considered as active. func (instInfo SessionInstanceState) IsActive() bool { - // Note: we will check other flags in the future, but that's said, - // deleted instance is considered inactive. - return !instInfo.IsDeleted() + // Note: we will check other flags in the future, but that's said, + // deleted instance is considered inactive. + return !instInfo.IsDeleted() } // IsDeleted returns true if the instance was deleted. @@ -654,13 +644,11 @@ func (instInfo SessionInstanceState) IsDeleted() bool { // SessionDeletionState holds information about // the deletion of an instance if the instance has been deleted. type SessionDeletionState struct { - Deleted_ bool + Deleted_ bool } var _ azcore.EntityDeletionInfo = SessionDeletionState{} -var _ azcore.ValueObjectAssert[ - SessionDeletionState, -] = SessionDeletionState{} +var _ azcore.ValueObjectAssert[SessionDeletionState] = SessionDeletionState{} func (instDelInfo SessionDeletionState) Clone() SessionDeletionState { // Already a copy and there's no shared underlying data instance diff --git a/iam/terminal__azgen.go b/iam/terminal__azgen.go index 712a6d6..fde056b 100644 --- a/iam/terminal__azgen.go +++ b/iam/terminal__azgen.go @@ -55,8 +55,8 @@ var _ = strings.Compare // an instance of adjunct entity Terminal system-wide. type TerminalID struct { application ApplicationID - user UserID - idNum TerminalIDNum // Differentiator + user UserID + idNum TerminalIDNum // Differentiator } // The total number of fields in the struct. @@ -71,8 +71,8 @@ func NewTerminalID( ) TerminalID { return TerminalID{ application: application, - user: user, - idNum: idNum, + user: user, + idNum: idNum, } } @@ -87,8 +87,8 @@ var _ azcore.TerminalID[TerminalIDNum] = _TerminalIDZero var _TerminalIDZero = TerminalID{ application: ApplicationIDZero(), - user: UserIDZero(), - idNum: TerminalIDNumZero, + user: UserIDZero(), + idNum: TerminalIDNumZero, } // TerminalIDZero returns @@ -297,8 +297,8 @@ func TerminalIDFromAZIDBinField( return TerminalID{ application: applicationID, - user: userID, - idNum: idNum, + user: userID, + idNum: idNum, }, dataCursor, nil } @@ -418,8 +418,8 @@ func (id TerminalID) WithApplication( ) TerminalID { return TerminalID{ application: application, - user: id.user, - idNum: id.idNum, + user: id.user, + idNum: id.idNum, } } @@ -446,8 +446,8 @@ func (id TerminalID) WithUser( ) TerminalID { return TerminalID{ application: id.application, - user: user, - idNum: id.idNum, + user: user, + idNum: id.idNum, } } @@ -474,17 +474,14 @@ var _ azcore.TerminalIDNumMethods = TerminalIDNumZero // TerminalIDNumIdentifierBitsMask is used to // extract identifier bits from an instance of TerminalIDNum. -const TerminalIDNumIdentifierBitsMask uint64 = - 0b_00000000_11111111_11111111_11111111_11111111_11111111_11111111_11111111 +const TerminalIDNumIdentifierBitsMask uint64 = 0b_00000000_11111111_11111111_11111111_11111111_11111111_11111111_11111111 // TerminalIDNumZero is the zero value for TerminalIDNum. -const TerminalIDNumZero = - TerminalIDNum(0) +const TerminalIDNumZero = TerminalIDNum(0) // _TerminalIDNumZeroVar is used for testing // pointer-based interfaces conformance. -var _TerminalIDNumZeroVar = - TerminalIDNumZero +var _TerminalIDNumZeroVar = TerminalIDNumZero // TerminalIDNumFromPrimitiveValue creates an instance // of TerminalIDNum from its primitive value. @@ -524,7 +521,7 @@ func (idNum TerminalIDNum) IsZero() bool { // a valid instance of Terminal. func (idNum TerminalIDNum) IsStaticallyValid() bool { return int64(idNum) > 0 && - (uint64(idNum) & TerminalIDNumIdentifierBitsMask) != 0 + (uint64(idNum)&TerminalIDNumIdentifierBitsMask) != 0 } // IsNotStaticallyValid returns the negation of value returned by IsStaticallyValid. @@ -583,8 +580,6 @@ func (idNum *TerminalIDNum) UnmarshalAZIDBinField( // Embedded fields const ( TerminalIDNumEmbeddedFieldsMask = 0b_00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000 - - ) //endregion @@ -595,9 +590,9 @@ const ( // attributes for adjunct Terminal. type TerminalAttributes struct { // AZxAdjunctEntityAttrSetBase - - secret string - displayName string + + secret string + displayName string acceptLanguage string } @@ -609,8 +604,8 @@ func NewTerminalAttributes( acceptLanguage string, ) TerminalAttributes { return TerminalAttributes{ - secret: secret, - displayName: displayName, + secret: secret, + displayName: displayName, acceptLanguage: acceptLanguage, } } @@ -620,8 +615,8 @@ var _ azcore.ValueObjectAssert[TerminalAttributes] = TerminalAttributes{} // Clone returns a copy of TerminalAttributes func (attrs TerminalAttributes) Clone() TerminalAttributes { return TerminalAttributes{ - secret: attrs.secret, - displayName: attrs.displayName, + secret: attrs.secret, + displayName: attrs.displayName, acceptLanguage: attrs.acceptLanguage, } } @@ -638,8 +633,8 @@ func (attrs TerminalAttributes) WithSecret( secret string, ) TerminalAttributes { return TerminalAttributes{ - secret: secret, - displayName: attrs.displayName, + secret: secret, + displayName: attrs.displayName, acceptLanguage: attrs.acceptLanguage, } } @@ -656,8 +651,8 @@ func (attrs TerminalAttributes) WithDisplayName( displayName string, ) TerminalAttributes { return TerminalAttributes{ - secret: attrs.secret, - displayName: displayName, + secret: attrs.secret, + displayName: displayName, acceptLanguage: attrs.acceptLanguage, } } @@ -674,8 +669,8 @@ func (attrs TerminalAttributes) WithAcceptLanguage( acceptLanguage string, ) TerminalAttributes { return TerminalAttributes{ - secret: attrs.secret, - displayName: attrs.displayName, + secret: attrs.secret, + displayName: attrs.displayName, acceptLanguage: acceptLanguage, } } @@ -715,7 +710,7 @@ type TerminalInstanceService interface { // provides access to instances metadata. type TerminalInstanceStateService interface { // GetTerminalInstanceState checks if the provided - // ref-key is valid and whether the instance is deleted. + // ref-key is valid and whether the instance is deleted. // // This method returns nil if the id is not referencing to any valid // instance. @@ -728,19 +723,17 @@ type TerminalInstanceStateService interface { // TerminalInstanceState holds information about // an instance of Terminal. type TerminalInstanceState struct { - RevisionNumber_ int32 + RevisionNumber_ int32 - // Deletion_ holds information about the deletion of the instance. If - // the instance has not been deleted, this field value will be nil. + // Deletion_ holds information about the deletion of the instance. If + // the instance has not been deleted, this field value will be nil. Deletion_ *TerminalDeletionState } var _ azcore.EntityInstanceInfo[ int32, TerminalDeletionState, ] = TerminalInstanceState{} -var _ azcore.ValueObjectAssert[ - TerminalDeletionState, -] = TerminalDeletionState{} +var _ azcore.ValueObjectAssert[TerminalDeletionState] = TerminalDeletionState{} // TerminalInstanceStateZero returns an instance of // TerminalInstanceState with attributes set their respective zero @@ -767,9 +760,9 @@ func (instInfo TerminalInstanceState) Deletion() *TerminalDeletionState { // IsActive returns true if the instance is considered as active. func (instInfo TerminalInstanceState) IsActive() bool { - // Note: we will check other flags in the future, but that's said, - // deleted instance is considered inactive. - return !instInfo.IsDeleted() + // Note: we will check other flags in the future, but that's said, + // deleted instance is considered inactive. + return !instInfo.IsDeleted() } // IsDeleted returns true if the instance was deleted. @@ -785,13 +778,11 @@ func (instInfo TerminalInstanceState) IsDeleted() bool { // TerminalDeletionState holds information about // the deletion of an instance if the instance has been deleted. type TerminalDeletionState struct { - Deleted_ bool + Deleted_ bool } var _ azcore.EntityDeletionInfo = TerminalDeletionState{} -var _ azcore.ValueObjectAssert[ - TerminalDeletionState, -] = TerminalDeletionState{} +var _ azcore.ValueObjectAssert[TerminalDeletionState] = TerminalDeletionState{} func (instDelInfo TerminalDeletionState) Clone() TerminalDeletionState { // Already a copy and there's no shared underlying data instance diff --git a/iam/user__azgen.go b/iam/user__azgen.go index cc3cc86..466319c 100644 --- a/iam/user__azgen.go +++ b/iam/user__azgen.go @@ -53,10 +53,9 @@ var _ azcore.EntityID[UserIDNum] = _UserIDZero var _ azcore.ValueObjectAssert[UserID] = _UserIDZero var _ azcore.UserID[UserIDNum] = _UserIDZero -const _UserIDZero = - UserID(UserIDNumZero) -var _UserIDZeroVar = - _UserIDZero +const _UserIDZero = UserID(UserIDNumZero) + +var _UserIDZeroVar = _UserIDZero // UserIDZero returns // a zero-valued instance of UserID. @@ -141,7 +140,7 @@ func (id UserID) EqualsUserID( } func (id UserID) AZIDBin() []byte { - b := make([]byte, 8 + 1) + b := make([]byte, 8+1) b[0] = UserIDNumBinDataType.Byte() binary.BigEndian.PutUint64(b[1:], uint64(id)) return b @@ -319,18 +318,15 @@ var _ azcore.UserIDNumMethods = UserIDNumZero // UserIDNumIdentifierBitsMask is used to // extract identifier bits from an instance of UserIDNum. -const UserIDNumIdentifierBitsMask uint64 = - 0b_00000000_00000000_11111111_11111111_11111111_11111111_11111111_11111111 +const UserIDNumIdentifierBitsMask uint64 = 0b_00000000_00000000_11111111_11111111_11111111_11111111_11111111_11111111 // UserIDNumZero is the zero value // for UserIDNum. -const UserIDNumZero = - UserIDNum(0) +const UserIDNumZero = UserIDNum(0) // _UserIDNumZeroVar is used for testing // pointer-based interfaces conformance. -var _UserIDNumZeroVar = - UserIDNumZero +var _UserIDNumZeroVar = UserIDNumZero // UserIDNumFromPrimitiveValue creates an instance // of UserIDNum from its primitive value. @@ -384,7 +380,7 @@ func (idNum UserIDNum) IsZero() bool { // valid, but it's considered invalid because it's a fake. func (idNum UserIDNum) IsStaticallyValid() bool { return int64(idNum) > 0 && - (uint64(idNum) & UserIDNumIdentifierBitsMask) != 0 + (uint64(idNum)&UserIDNumIdentifierBitsMask) != 0 } // IsNotStaticallyValid returns the negation of value returned by IsStaticallyValid. @@ -444,7 +440,6 @@ func (idNum *UserIDNum) UnmarshalAZIDBinField( const ( UserIDNumEmbeddedFieldsMask = 0b_01000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000 - UserIDNumBotMask = 0b_01000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000 UserIDNumBotBits = 0b_01000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000 ) @@ -475,23 +470,20 @@ func (idNum UserIDNum) HasBotBits() bool { // entity's built-in attributes. type UserAttrSet struct { // AZxEntityAttrSetBase - + } // NewUserAttrSet returns a new instance // of UserAttrSet with the provided attribute values. -func NewUserAttrSet( -) UserAttrSet { - return UserAttrSet{ - } +func NewUserAttrSet() UserAttrSet { + return UserAttrSet{} } var _ azcore.ValueObjectAssert[UserAttrSet] = UserAttrSet{} // Clone returns a copy of UserAttrSet func (attrs UserAttrSet) Clone() UserAttrSet { - return UserAttrSet{ - } + return UserAttrSet{} } func (attrs UserAttrSet) Equals( @@ -526,7 +518,7 @@ type UserInstanceService interface { // provides access to instances metadata. type UserInstanceStateService interface { // GetUserInstanceState checks if the provided - // ref-key is valid and whether the instance is deleted. + // ref-key is valid and whether the instance is deleted. // // This method returns nil if the id is not referencing to any valid // instance. @@ -539,19 +531,17 @@ type UserInstanceStateService interface { // UserInstanceState holds information about // an instance of User. type UserInstanceState struct { - RevisionNumber_ int32 + RevisionNumber_ int32 - // Deletion_ holds information about the deletion of the instance. If - // the instance has not been deleted, this field value will be nil. + // Deletion_ holds information about the deletion of the instance. If + // the instance has not been deleted, this field value will be nil. Deletion_ *UserDeletionState } var _ azcore.EntityInstanceInfo[ int32, UserDeletionState, ] = UserInstanceState{} -var _ azcore.ValueObjectAssert[ - UserDeletionState, -] = UserDeletionState{} +var _ azcore.ValueObjectAssert[UserDeletionState] = UserDeletionState{} // UserInstanceStateZero returns an instance of // UserInstanceState with attributes set their respective zero @@ -578,9 +568,9 @@ func (instInfo UserInstanceState) Deletion() *UserDeletionState { // IsActive returns true if the instance is considered as active. func (instInfo UserInstanceState) IsActive() bool { - // Note: we will check other flags in the future, but that's said, - // deleted instance is considered inactive. - return !instInfo.IsDeleted() + // Note: we will check other flags in the future, but that's said, + // deleted instance is considered inactive. + return !instInfo.IsDeleted() } // IsDeleted returns true if the instance was deleted. @@ -601,9 +591,7 @@ type UserDeletionState struct { } var _ azcore.EntityDeletionInfo = UserDeletionState{} -var _ azcore.ValueObjectAssert[ - UserDeletionState, -] = UserDeletionState{} +var _ azcore.ValueObjectAssert[UserDeletionState] = UserDeletionState{} func (instDelInfo UserDeletionState) Clone() UserDeletionState { // Already a copy and there's no shared underlying data instance @@ -627,7 +615,7 @@ type UserInstanceServiceInternal interface { CreateUserInternal( ctx context.Context, input UserCreationParams, - ) (id UserID, initialState UserInstanceState, err error); + ) (id UserID, initialState UserInstanceState, err error) // DeleteUserInternal deletes an instance of // User entity based identfied by idOfInstToDel. @@ -663,7 +651,9 @@ type UserDeletionParams struct { type UserService interface { // AZxEntityService + UserIDService UserInstanceService + UserInstanceStateService } // UserServiceClient is the interface for