Skip to content

Commit

Permalink
api: Deprecate AllowProfilesOutsideOrganization and fix passing of …
Browse files Browse the repository at this point in the history
…`DomainData` (#349)

* Mark `AllowProfilesOutsideOrganization` as deprecated

* Omit `domains` when empty

* `DomainData` missing from `UpdateOrganizationChangeOpts`
  • Loading branch information
mthadley authored Jun 17, 2024
1 parent c26db6a commit a62979e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions pkg/organizations/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ type Organization struct {

// Whether Connections within the Organization allow profiles that are
// outside of the Organization's configured User Email Domains.
//
// Deprecated: If you need to allow sign-ins from any email domain, contact [email protected].
AllowProfilesOutsideOrganization bool `json:"allow_profiles_outside_organization"`

// The Organization's Domains.
Expand Down Expand Up @@ -148,6 +150,8 @@ type CreateOrganizationOpts struct {

// Whether Connections within the Organization allow profiles that are
// outside of the Organization's configured User Email Domains.
//
// Deprecated: If you need to allow sign-ins from any email domain, contact [email protected].
AllowProfilesOutsideOrganization bool `json:"allow_profiles_outside_organization"`

// Domains of the Organization.
Expand All @@ -172,6 +176,8 @@ type UpdateOrganizationOpts struct {

// Whether Connections within the Organization allow profiles that are
// outside of the Organization's configured User Email Domains.
//
// Deprecated: If you need to allow sign-ins from any email domain, contact [email protected].
AllowProfilesOutsideOrganization bool

// Domains of the Organization.
Expand Down Expand Up @@ -328,10 +334,15 @@ func (c *Client) UpdateOrganization(ctx context.Context, opts UpdateOrganization
AllowProfilesOutsideOrganization bool `json:"allow_profiles_outside_organization"`

// Domains of the Organization.
Domains []string `json:"domains"`
DomainData []OrganizationDomainData `json:"domain_data,omitempty"`

// Domains of the Organization.
//
// Deprecated: Use DomainData instead.
Domains []string `json:"domains,omitempty"`
}

update_opts := UpdateOrganizationChangeOpts{opts.Name, opts.AllowProfilesOutsideOrganization, opts.Domains}
update_opts := UpdateOrganizationChangeOpts{opts.Name, opts.AllowProfilesOutsideOrganization, opts.DomainData, opts.Domains}

data, err := c.JSONEncode(update_opts)
if err != nil {
Expand Down

0 comments on commit a62979e

Please sign in to comment.