Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make msgraph.Group a hashable type - change types of unhashable fields #160

Merged
merged 1 commit into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion msgraph/groups_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestGroupsClient(t *testing.T) {

newGroup365 := msgraph.Group{
DisplayName: utils.StringPtr("test-group-365"),
GroupTypes: []msgraph.GroupType{msgraph.GroupTypeUnified},
GroupTypes: &[]msgraph.GroupType{msgraph.GroupTypeUnified},
MailEnabled: utils.BoolPtr(true),
MailNickname: utils.StringPtr(fmt.Sprintf("test-365-group-%s", c.RandomString)),
SecurityEnabled: utils.BoolPtr(true),
Expand Down
8 changes: 4 additions & 4 deletions msgraph/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ type Group struct {
Description *StringNullWhenEmpty `json:"description,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
ExpirationDateTime *time.Time `json:"expirationDateTime,omitempty"`
GroupTypes []GroupType `json:"groupTypes,omitempty"`
GroupTypes *[]GroupType `json:"groupTypes,omitempty"`
HasMembersWithLicenseErrors *bool `json:"hasMembersWithLicenseErrors,omitempty"`
HideFromAddressLists *bool `json:"hideFromAddressLists,omitempty"`
HideFromOutlookClients *bool `json:"hideFromOutlookClients,omitempty"`
Expand All @@ -887,8 +887,8 @@ type Group struct {
PreferredLanguage *string `json:"preferredLanguage,omitempty"`
ProxyAddresses *[]string `json:"proxyAddresses,omitempty"`
RenewedDateTime *time.Time `json:"renewedDateTime,omitempty"`
ResourceBehaviorOptions []GroupResourceBehaviorOption `json:"resourceBehaviorOptions,omitempty"`
ResourceProvisioningOptions []GroupResourceProvisioningOption `json:"resourceProvisioningOptions,omitempty"`
ResourceBehaviorOptions *[]GroupResourceBehaviorOption `json:"resourceBehaviorOptions,omitempty"`
ResourceProvisioningOptions *[]GroupResourceProvisioningOption `json:"resourceProvisioningOptions,omitempty"`
SecurityEnabled *bool `json:"securityEnabled,omitempty"`
SecurityIdentifier *string `json:"securityIdentifier,omitempty"`
Theme *GroupTheme `json:"theme,omitempty"`
Expand Down Expand Up @@ -945,7 +945,7 @@ func (g *Group) UnmarshalJSON(data []byte) error {
func (g *Group) HasTypes(types []GroupType) bool {
for _, t := range types {
found := false
for _, gt := range g.GroupTypes {
for _, gt := range *g.GroupTypes {
if t == gt {
found = true
break
Expand Down
2 changes: 1 addition & 1 deletion msgraph/schema_extensions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func testSchemaExtensionsGroup(t *testing.T, c *test.Test, schema *msgraph.Schem
// First create a group having schema extension data expressed using msgraph.SchemaExtensionMap
group := testGroupsClient_Create(t, c, msgraph.Group{
DisplayName: utils.StringPtr("test-group"),
GroupTypes: []msgraph.GroupType{msgraph.GroupTypeUnified},
GroupTypes: &[]msgraph.GroupType{msgraph.GroupTypeUnified},
MailEnabled: utils.BoolPtr(true),
MailNickname: utils.StringPtr(fmt.Sprintf("test-365-group-%s", c.RandomString)),
SecurityEnabled: utils.BoolPtr(true),
Expand Down