Skip to content

Commit

Permalink
Merge pull request #160 from maxsokolovsky/make-group-hashable
Browse files Browse the repository at this point in the history
Make msgraph.Group a hashable type - change types of unhashable fields
  • Loading branch information
manicminer authored Sep 29, 2022
2 parents fb66fbf + ef61986 commit cddebf5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
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

0 comments on commit cddebf5

Please sign in to comment.