-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PDI-1511: Add pingone_branding_settings (Resource) Export (#44)
* PDI-1511: Add pingone_branding_settings (Resource) Export * Allow export env id specification. Validate env id. Do not source env id from API response data. * Provide a 404 specific error message when export env id does not exist.
- Loading branch information
1 parent
ac9588c
commit 87d48f6
Showing
9 changed files
with
131 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
internal/connector/pingone_platform/resources/pingone_branding_settings.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package resources | ||
|
||
import ( | ||
"github.com/pingidentity/pingctl/internal/connector" | ||
"github.com/pingidentity/pingctl/internal/logger" | ||
) | ||
|
||
// Verify that the resource satisfies the exportable resource interface | ||
var ( | ||
_ connector.ExportableResource = &PingoneBrandingSettingsResource{} | ||
) | ||
|
||
type PingoneBrandingSettingsResource struct { | ||
clientInfo *connector.SDKClientInfo | ||
} | ||
|
||
// Utility method for creating a PingoneAgreementLocalizationRevisionResource | ||
func BrandingSettingsResource(clientInfo *connector.SDKClientInfo) *PingoneBrandingSettingsResource { | ||
return &PingoneBrandingSettingsResource{ | ||
clientInfo: clientInfo, | ||
} | ||
} | ||
|
||
func (r *PingoneBrandingSettingsResource) ExportAll() (*[]connector.ImportBlock, error) { | ||
l := logger.Get() | ||
|
||
l.Debug().Msgf("Fetching all pingone_branding_settings resources...") | ||
|
||
importBlocks := []connector.ImportBlock{} | ||
|
||
importBlocks = append(importBlocks, connector.ImportBlock{ | ||
ResourceType: r.ResourceType(), | ||
ResourceName: "branding", | ||
ResourceID: r.clientInfo.ExportEnvironmentID, | ||
}) | ||
|
||
return &importBlocks, nil | ||
} | ||
|
||
func (r *PingoneBrandingSettingsResource) ResourceType() string { | ||
return "pingone_branding_settings" | ||
} |