From 3cd836a2255036af73da729094d169f751d214cf Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Mon, 17 Apr 2023 15:17:51 +0100 Subject: [PATCH] Support organization_id on Ticket Closes #192 --- management/management.gen.go | 8 ++++++++ management/management.gen_test.go | 10 ++++++++++ management/ticket.go | 8 ++++++++ 3 files changed, 26 insertions(+) diff --git a/management/management.gen.go b/management/management.gen.go index f21e0c05..9bef4c52 100644 --- a/management/management.gen.go +++ b/management/management.gen.go @@ -7560,6 +7560,14 @@ func (t *Ticket) GetMarkEmailAsVerified() bool { return *t.MarkEmailAsVerified } +// GetOrganizationID returns the OrganizationID field if it's non-nil, zero value otherwise. +func (t *Ticket) GetOrganizationID() string { + if t == nil || t.OrganizationID == nil { + return "" + } + return *t.OrganizationID +} + // GetResultURL returns the ResultURL field if it's non-nil, zero value otherwise. func (t *Ticket) GetResultURL() string { if t == nil || t.ResultURL == nil { diff --git a/management/management.gen_test.go b/management/management.gen_test.go index b729c577..e3a3c36e 100644 --- a/management/management.gen_test.go +++ b/management/management.gen_test.go @@ -9615,6 +9615,16 @@ func TestTicket_GetMarkEmailAsVerified(tt *testing.T) { t.GetMarkEmailAsVerified() } +func TestTicket_GetOrganizationID(tt *testing.T) { + var zeroValue string + t := &Ticket{OrganizationID: &zeroValue} + t.GetOrganizationID() + t = &Ticket{} + t.GetOrganizationID() + t = nil + t.GetOrganizationID() +} + func TestTicket_GetResultURL(tt *testing.T) { var zeroValue string t := &Ticket{ResultURL: &zeroValue} diff --git a/management/ticket.go b/management/ticket.go index 5a130998..443567ee 100644 --- a/management/ticket.go +++ b/management/ticket.go @@ -45,6 +45,14 @@ type Ticket struct { // Whether to include the email address as part of the returnUrl in // the reset_email (true), or not (false - default). IncludeEmailInRedirect *bool `json:"includeEmailInRedirect,omitempty"` + + // The ID of the Organization. If provided, organization parameters will be made + // available to the email template and organization branding will be applied to the + // prompt. In addition, the redirect link in the prompt will include organization_id + // and organization_name query string parameters. + // + // Conflicts with: ResultURL + OrganizationID *string `json:"organization_id,omitempty"` } // TicketManager manages Auth0 Ticket resources.