From 2289727a6d784126f717553900e998a9745a4d2d Mon Sep 17 00:00:00 2001 From: Sergiu Ghitea <28300158+sergiught@users.noreply.github.com> Date: Tue, 12 Sep 2023 10:19:03 +0200 Subject: [PATCH] Add missing properties to GoogleApps conn (#278) --- management/connection.go | 41 ++++++++++++------------- management/management.gen.go | 40 +++++++++++++++++++++++++ management/management.gen_test.go | 50 +++++++++++++++++++++++++++++++ 3 files changed, 111 insertions(+), 20 deletions(-) diff --git a/management/connection.go b/management/connection.go index 0f88fbd0..0d9e21d5 100644 --- a/management/connection.go +++ b/management/connection.go @@ -1142,26 +1142,27 @@ func (c *ConnectionOptionsSAML) SetScopes(enable bool, scopes ...string) { // ConnectionOptionsGoogleApps is used to configure a GoogleApps Connection. type ConnectionOptionsGoogleApps struct { - ClientID *string `json:"client_id,omitempty"` - ClientSecret *string `json:"client_secret,omitempty"` - Domain *string `json:"domain,omitempty"` - TenantDomain *string `json:"tenant_domain,omitempty"` - - EnableUsersAPI *bool `json:"api_enable_users,omitempty"` - BasicProfile *bool `json:"basic_profile,omitempty" scope:"basic_profile"` - ExtendedProfile *bool `json:"ext_profile,omitempty" scope:"ext_profile"` - Groups *bool `json:"ext_groups,omitempty" scope:"ext_groups"` - Admin *bool `json:"ext_is_admin,omitempty" scope:"ext_is_admin"` - IsSuspended *bool `json:"ext_is_suspended,omitempty" scope:"ext_is_suspended"` - AgreedTerms *bool `json:"ext_agreed_terms,omitempty" scope:"ext_agreed_terms"` - - SetUserAttributes *string `json:"set_user_root_attributes,omitempty"` - NonPersistentAttrs *[]string `json:"non_persistent_attrs,omitempty"` - - DomainAliases *[]string `json:"domain_aliases,omitempty"` - LogoURL *string `json:"icon_url,omitempty"` - - UpstreamParams map[string]interface{} `json:"upstream_params,omitempty"` + ClientID *string `json:"client_id,omitempty"` + ClientSecret *string `json:"client_secret,omitempty"` + Domain *string `json:"domain,omitempty"` + TenantDomain *string `json:"tenant_domain,omitempty"` + BasicProfile *bool `json:"basic_profile,omitempty" scope:"basic_profile"` + ExtendedProfile *bool `json:"ext_profile,omitempty" scope:"ext_profile"` + Groups *bool `json:"ext_groups,omitempty" scope:"ext_groups"` + Admin *bool `json:"ext_is_admin,omitempty" scope:"ext_is_admin"` + IsSuspended *bool `json:"ext_is_suspended,omitempty" scope:"ext_is_suspended"` + AgreedTerms *bool `json:"ext_agreed_terms,omitempty" scope:"ext_agreed_terms"` + EnableUsersAPI *bool `json:"api_enable_users,omitempty"` + SetUserAttributes *string `json:"set_user_root_attributes,omitempty"` + MapUserIDtoID *bool `json:"map_user_id_to_id,omitempty"` + HandleLoginFromSocial *bool `json:"handle_login_from_social,omitempty"` + DomainAliases *[]string `json:"domain_aliases,omitempty"` + LogoURL *string `json:"icon_url,omitempty"` + AdminAccessTokenExpiresIn *string `json:"admin_access_token_expiresin,omitempty"` + AdminAccessToken *string `json:"admin_access_token,omitempty"` + AdminRefreshToken *string `json:"admin_refresh_token,omitempty"` + UpstreamParams map[string]interface{} `json:"upstream_params,omitempty"` + NonPersistentAttrs *[]string `json:"non_persistent_attrs,omitempty"` } // Scopes returns the scopes for ConnectionOptionsGoogleApps. diff --git a/management/management.gen.go b/management/management.gen.go index b8650f24..6675ebfb 100644 --- a/management/management.gen.go +++ b/management/management.gen.go @@ -3550,6 +3550,30 @@ func (c *ConnectionOptionsGoogleApps) GetAdmin() bool { return *c.Admin } +// GetAdminAccessToken returns the AdminAccessToken field if it's non-nil, zero value otherwise. +func (c *ConnectionOptionsGoogleApps) GetAdminAccessToken() string { + if c == nil || c.AdminAccessToken == nil { + return "" + } + return *c.AdminAccessToken +} + +// GetAdminAccessTokenExpiresIn returns the AdminAccessTokenExpiresIn field if it's non-nil, zero value otherwise. +func (c *ConnectionOptionsGoogleApps) GetAdminAccessTokenExpiresIn() string { + if c == nil || c.AdminAccessTokenExpiresIn == nil { + return "" + } + return *c.AdminAccessTokenExpiresIn +} + +// GetAdminRefreshToken returns the AdminRefreshToken field if it's non-nil, zero value otherwise. +func (c *ConnectionOptionsGoogleApps) GetAdminRefreshToken() string { + if c == nil || c.AdminRefreshToken == nil { + return "" + } + return *c.AdminRefreshToken +} + // GetAgreedTerms returns the AgreedTerms field if it's non-nil, zero value otherwise. func (c *ConnectionOptionsGoogleApps) GetAgreedTerms() bool { if c == nil || c.AgreedTerms == nil { @@ -3622,6 +3646,14 @@ func (c *ConnectionOptionsGoogleApps) GetGroups() bool { return *c.Groups } +// GetHandleLoginFromSocial returns the HandleLoginFromSocial field if it's non-nil, zero value otherwise. +func (c *ConnectionOptionsGoogleApps) GetHandleLoginFromSocial() bool { + if c == nil || c.HandleLoginFromSocial == nil { + return false + } + return *c.HandleLoginFromSocial +} + // GetIsSuspended returns the IsSuspended field if it's non-nil, zero value otherwise. func (c *ConnectionOptionsGoogleApps) GetIsSuspended() bool { if c == nil || c.IsSuspended == nil { @@ -3638,6 +3670,14 @@ func (c *ConnectionOptionsGoogleApps) GetLogoURL() string { return *c.LogoURL } +// GetMapUserIDtoID returns the MapUserIDtoID field if it's non-nil, zero value otherwise. +func (c *ConnectionOptionsGoogleApps) GetMapUserIDtoID() bool { + if c == nil || c.MapUserIDtoID == nil { + return false + } + return *c.MapUserIDtoID +} + // GetNonPersistentAttrs returns the NonPersistentAttrs field if it's non-nil, zero value otherwise. func (c *ConnectionOptionsGoogleApps) GetNonPersistentAttrs() []string { if c == nil || c.NonPersistentAttrs == nil { diff --git a/management/management.gen_test.go b/management/management.gen_test.go index b6156979..b5acf301 100644 --- a/management/management.gen_test.go +++ b/management/management.gen_test.go @@ -4399,6 +4399,36 @@ func TestConnectionOptionsGoogleApps_GetAdmin(tt *testing.T) { c.GetAdmin() } +func TestConnectionOptionsGoogleApps_GetAdminAccessToken(tt *testing.T) { + var zeroValue string + c := &ConnectionOptionsGoogleApps{AdminAccessToken: &zeroValue} + c.GetAdminAccessToken() + c = &ConnectionOptionsGoogleApps{} + c.GetAdminAccessToken() + c = nil + c.GetAdminAccessToken() +} + +func TestConnectionOptionsGoogleApps_GetAdminAccessTokenExpiresIn(tt *testing.T) { + var zeroValue string + c := &ConnectionOptionsGoogleApps{AdminAccessTokenExpiresIn: &zeroValue} + c.GetAdminAccessTokenExpiresIn() + c = &ConnectionOptionsGoogleApps{} + c.GetAdminAccessTokenExpiresIn() + c = nil + c.GetAdminAccessTokenExpiresIn() +} + +func TestConnectionOptionsGoogleApps_GetAdminRefreshToken(tt *testing.T) { + var zeroValue string + c := &ConnectionOptionsGoogleApps{AdminRefreshToken: &zeroValue} + c.GetAdminRefreshToken() + c = &ConnectionOptionsGoogleApps{} + c.GetAdminRefreshToken() + c = nil + c.GetAdminRefreshToken() +} + func TestConnectionOptionsGoogleApps_GetAgreedTerms(tt *testing.T) { var zeroValue bool c := &ConnectionOptionsGoogleApps{AgreedTerms: &zeroValue} @@ -4489,6 +4519,16 @@ func TestConnectionOptionsGoogleApps_GetGroups(tt *testing.T) { c.GetGroups() } +func TestConnectionOptionsGoogleApps_GetHandleLoginFromSocial(tt *testing.T) { + var zeroValue bool + c := &ConnectionOptionsGoogleApps{HandleLoginFromSocial: &zeroValue} + c.GetHandleLoginFromSocial() + c = &ConnectionOptionsGoogleApps{} + c.GetHandleLoginFromSocial() + c = nil + c.GetHandleLoginFromSocial() +} + func TestConnectionOptionsGoogleApps_GetIsSuspended(tt *testing.T) { var zeroValue bool c := &ConnectionOptionsGoogleApps{IsSuspended: &zeroValue} @@ -4509,6 +4549,16 @@ func TestConnectionOptionsGoogleApps_GetLogoURL(tt *testing.T) { c.GetLogoURL() } +func TestConnectionOptionsGoogleApps_GetMapUserIDtoID(tt *testing.T) { + var zeroValue bool + c := &ConnectionOptionsGoogleApps{MapUserIDtoID: &zeroValue} + c.GetMapUserIDtoID() + c = &ConnectionOptionsGoogleApps{} + c.GetMapUserIDtoID() + c = nil + c.GetMapUserIDtoID() +} + func TestConnectionOptionsGoogleApps_GetNonPersistentAttrs(tt *testing.T) { var zeroValue []string c := &ConnectionOptionsGoogleApps{NonPersistentAttrs: &zeroValue}