Skip to content

Commit

Permalink
terraform test
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardo-angelilli committed Nov 14, 2023
1 parent c855c52 commit 2a73fd3
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 73 deletions.
62 changes: 30 additions & 32 deletions projectv1/project_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -1062,8 +1062,7 @@ func (project *ProjectV1) UpdateConfigWithContext(ctx context.Context, updateCon
}

// DeleteConfig : Delete a configuration in a project by ID
// Delete a configuration in a project. Deleting the configuration will also destroy all the resources deployed by the
// configuration if the query parameter `destroy` is specified.
// Delete a configuration in a project.
func (project *ProjectV1) DeleteConfig(deleteConfigOptions *DeleteConfigOptions) (result *ProjectConfigDelete, response *core.DetailedResponse, err error) {
return project.DeleteConfigWithContext(context.Background(), deleteConfigOptions)
}
Expand Down Expand Up @@ -1389,8 +1388,8 @@ func (project *ProjectV1) DeployConfigWithContext(ctx context.Context, deployCon
return
}

// UndeployConfig : Destroy configuration resources
// Destroy a project's configuration resources. The operation destroys all the resources that are deployed with the
// UndeployConfig : Undeploy configuration resources
// Undeploy a project's configuration resources. The operation undeploys all the resources that are deployed with the
// specific configuration. You can track it by using the get project configuration API with full metadata.
func (project *ProjectV1) UndeployConfig(undeployConfigOptions *UndeployConfigOptions) (response *core.DetailedResponse, err error) {
return project.UndeployConfigWithContext(context.Background(), undeployConfigOptions)
Expand Down Expand Up @@ -1684,8 +1683,7 @@ func (project *ProjectV1) GetConfigVersionWithContext(ctx context.Context, getCo
}

// DeleteConfigVersion : Delete a configuration for the specified project ID and version
// Delete a configuration in a project. Deleting the configuration will also destroy all the resources deployed by the
// configuration if the query parameter `destroy` is specified.
// Delete a configuration in a project.
func (project *ProjectV1) DeleteConfigVersion(deleteConfigVersionOptions *DeleteConfigVersionOptions) (result *ProjectConfigDelete, response *core.DetailedResponse, err error) {
return project.DeleteConfigVersionWithContext(context.Background(), deleteConfigVersionOptions)
}
Expand Down Expand Up @@ -2642,7 +2640,7 @@ func UnmarshalEnvironmentCollection(m map[string]json.RawMessage, result interfa

// EnvironmentDefinitionNameDescription : The environment definition used in the project collection.
type EnvironmentDefinitionNameDescription struct {
// The name of the environment.
// The name of the environment. It is unique within the account across projects and regions.
Name *string `json:"name,omitempty"`

// The description of the environment.
Expand All @@ -2666,7 +2664,7 @@ func UnmarshalEnvironmentDefinitionNameDescription(m map[string]json.RawMessage,

// EnvironmentDefinitionProperties : The environment definition used for updates.
type EnvironmentDefinitionProperties struct {
// The name of the environment.
// The name of the environment. It is unique within the account across projects and regions.
Name *string `json:"name,omitempty"`

// The description of the environment.
Expand Down Expand Up @@ -2711,7 +2709,7 @@ func UnmarshalEnvironmentDefinitionProperties(m map[string]json.RawMessage, resu

// EnvironmentDefinitionRequiredProperties : The environment definition.
type EnvironmentDefinitionRequiredProperties struct {
// The name of the environment.
// The name of the environment. It is unique within the account across projects and regions.
Name *string `json:"name" validate:"required"`

// The description of the environment.
Expand Down Expand Up @@ -3418,7 +3416,7 @@ type Project struct {
// retrieving the cumulative needs attention view.
CumulativeNeedsAttentionViewError *bool `json:"cumulative_needs_attention_view_error,omitempty"`

// The unique ID.
// The unique project ID.
ID *string `json:"id" validate:"required"`

// The IBM Cloud location where a resource is deployed.
Expand Down Expand Up @@ -3588,16 +3586,16 @@ func (resp *ProjectCollection) GetNextStart() (*string, error) {

// ProjectComplianceProfile : The profile required for compliance.
type ProjectComplianceProfile struct {
// The unique ID.
// The unique ID for that compliance profile.
ID *string `json:"id,omitempty"`

// The unique ID.
// A unique ID for an instance of a compliance profile.
InstanceID *string `json:"instance_id,omitempty"`

// The location of the compliance instance.
InstanceLocation *string `json:"instance_location,omitempty"`

// The unique ID.
// A unique ID for the attachment to a compliance profile.
AttachmentID *string `json:"attachment_id,omitempty"`

// The name of the compliance profile.
Expand Down Expand Up @@ -3861,7 +3859,7 @@ func UnmarshalProjectConfigCollection(m map[string]json.RawMessage, result inter

// ProjectConfigDefinitionNameDescription : The name and description of a project configuration.
type ProjectConfigDefinitionNameDescription struct {
// The configuration name.
// The configuration name. It is unique within the account across projects and regions.
Name *string `json:"name,omitempty"`

// A project configuration description.
Expand All @@ -3885,7 +3883,7 @@ func UnmarshalProjectConfigDefinitionNameDescription(m map[string]json.RawMessag

// ProjectConfigDelete : Deletes the configuration response.
type ProjectConfigDelete struct {
// The unique ID.
// The unique configuration ID.
ID *string `json:"id" validate:"required"`
}

Expand Down Expand Up @@ -4076,22 +4074,22 @@ func UnmarshalProjectConfigMetadataLastApproved(m map[string]json.RawMessage, re

// ProjectConfigPatchDefinitionBlock : The name and description of a project configuration.
type ProjectConfigPatchDefinitionBlock struct {
// The configuration name.
// The configuration name. It is unique within the account across projects and regions.
Name *string `json:"name,omitempty"`

// A project configuration description.
Description *string `json:"description,omitempty"`

// The ID of the project environment.
Environment *string `json:"environment,omitempty"`
EnvironmentID *string `json:"environment_id,omitempty"`

// The authorization details. You can authorize by using a trusted profile or an API key in Secrets Manager.
Authorizations *ProjectConfigAuth `json:"authorizations,omitempty"`

// The profile required for compliance.
ComplianceProfile *ProjectComplianceProfile `json:"compliance_profile,omitempty"`

// A dotted value of catalogID.versionID.
// A unique concanctenation of catalogID.versionID that identifies the DA in catalog.
LocatorID *string `json:"locator_id,omitempty"`

// The input variables for configuration definition and environment.
Expand All @@ -4113,7 +4111,7 @@ func UnmarshalProjectConfigPatchDefinitionBlock(m map[string]json.RawMessage, re
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "environment", &obj.Environment)
err = core.UnmarshalPrimitive(m, "environment_id", &obj.EnvironmentID)
if err != nil {
return
}
Expand Down Expand Up @@ -4176,22 +4174,22 @@ func UnmarshalProjectConfigPrototype(m map[string]json.RawMessage, result interf

// ProjectConfigPrototypeDefinitionBlock : The name and description of a project configuration.
type ProjectConfigPrototypeDefinitionBlock struct {
// The configuration name.
// The configuration name. It is unique within the account across projects and regions.
Name *string `json:"name" validate:"required"`

// A project configuration description.
Description *string `json:"description,omitempty"`

// The ID of the project environment.
Environment *string `json:"environment,omitempty"`
EnvironmentID *string `json:"environment_id,omitempty"`

// The authorization details. You can authorize by using a trusted profile or an API key in Secrets Manager.
Authorizations *ProjectConfigAuth `json:"authorizations,omitempty"`

// The profile required for compliance.
ComplianceProfile *ProjectComplianceProfile `json:"compliance_profile,omitempty"`

// A dotted value of catalogID.versionID.
// A unique concanctenation of catalogID.versionID that identifies the DA in catalog.
LocatorID *string `json:"locator_id,omitempty"`

// The input variables for configuration definition and environment.
Expand Down Expand Up @@ -4222,7 +4220,7 @@ func UnmarshalProjectConfigPrototypeDefinitionBlock(m map[string]json.RawMessage
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "environment", &obj.Environment)
err = core.UnmarshalPrimitive(m, "environment_id", &obj.EnvironmentID)
if err != nil {
return
}
Expand Down Expand Up @@ -4321,22 +4319,22 @@ func UnmarshalProjectConfigResourceCollection(m map[string]json.RawMessage, resu

// ProjectConfigResponseDefinition : The type and output of a project configuration.
type ProjectConfigResponseDefinition struct {
// The configuration name.
// The configuration name. It is unique within the account across projects and regions.
Name *string `json:"name" validate:"required"`

// A project configuration description.
Description *string `json:"description,omitempty"`

// The ID of the project environment.
Environment *string `json:"environment,omitempty"`
EnvironmentID *string `json:"environment_id,omitempty"`

// The authorization details. You can authorize by using a trusted profile or an API key in Secrets Manager.
Authorizations *ProjectConfigAuth `json:"authorizations,omitempty"`

// The profile required for compliance.
ComplianceProfile *ProjectComplianceProfile `json:"compliance_profile,omitempty"`

// A dotted value of catalogID.versionID.
// A unique concanctenation of catalogID.versionID that identifies the DA in catalog.
LocatorID *string `json:"locator_id" validate:"required"`

// The input variables for configuration definition and environment.
Expand Down Expand Up @@ -4368,7 +4366,7 @@ func UnmarshalProjectConfigResponseDefinition(m map[string]json.RawMessage, resu
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "environment", &obj.Environment)
err = core.UnmarshalPrimitive(m, "environment_id", &obj.EnvironmentID)
if err != nil {
return
}
Expand Down Expand Up @@ -4793,7 +4791,7 @@ func UnmarshalProjectConfigVersionSummaryCollection(m map[string]json.RawMessage

// ProjectDefinitionProperties : The definition of the project.
type ProjectDefinitionProperties struct {
// The name of the project.
// The name of the project. It is unique within the account across regions.
Name *string `json:"name" validate:"required"`

// A brief explanation of the project's use in the configuration of a deployable architecture. It is possible to create
Expand Down Expand Up @@ -4888,7 +4886,7 @@ func UnmarshalProjectEnvironmentSummary(m map[string]json.RawMessage, result int

// ProjectPatchDefinitionBlock : The definition of the project.
type ProjectPatchDefinitionBlock struct {
// The name of the project.
// The name of the project. It is unique within the account across regions.
Name *string `json:"name,omitempty"`

// A brief explanation of the project's use in the configuration of a deployable architecture. It is possible to create
Expand Down Expand Up @@ -4920,14 +4918,14 @@ func UnmarshalProjectPatchDefinitionBlock(m map[string]json.RawMessage, result i

// ProjectPrototypeDefinition : The definition of the project.
type ProjectPrototypeDefinition struct {
// The name of the project.
// The name of the project. It is unique within the account across regions.
Name *string `json:"name" validate:"required"`

// A brief explanation of the project's use in the configuration of a deployable architecture. It is possible to create
// a project without providing a description.
Description *string `json:"description,omitempty"`

// The policy that indicates whether the resources are destroyed or not when a project is deleted.
// The policy that indicates whether the resources are undeployed or not when a project is deleted.
DestroyOnDelete *bool `json:"destroy_on_delete,omitempty"`
}

Expand Down Expand Up @@ -5014,7 +5012,7 @@ type ProjectSummary struct {
// retrieving the cumulative needs attention view.
CumulativeNeedsAttentionViewError *bool `json:"cumulative_needs_attention_view_error,omitempty"`

// The unique ID.
// The unique project ID.
ID *string `json:"id" validate:"required"`

// The IBM Cloud location where a resource is deployed.
Expand Down
8 changes: 4 additions & 4 deletions projectv1/project_v1_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() {
projectConfigPrototypeDefinitionBlockModel := &projectv1.ProjectConfigPrototypeDefinitionBlock{
Name: core.StringPtr("testString"),
Description: core.StringPtr("testString"),
Environment: core.StringPtr("testString"),
EnvironmentID: core.StringPtr("testString"),
Authorizations: projectConfigAuthModel,
ComplianceProfile: projectComplianceProfileModel,
LocatorID: core.StringPtr("testString"),
Expand Down Expand Up @@ -199,7 +199,7 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() {
projectConfigPrototypeDefinitionBlockModel := &projectv1.ProjectConfigPrototypeDefinitionBlock{
Name: core.StringPtr("env-stage"),
Description: core.StringPtr("Stage environment configuration, which includes services common to all the environment regions. There must be a blueprint configuring all the services common to the stage regions. It is a terraform_template type of configuration that points to a Github repo hosting the terraform modules that can be deployed by a Schematics Workspace."),
Environment: core.StringPtr("testString"),
EnvironmentID: core.StringPtr("testString"),
Authorizations: projectConfigAuthModel,
ComplianceProfile: projectComplianceProfileModel,
LocatorID: core.StringPtr("1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global"),
Expand Down Expand Up @@ -517,7 +517,7 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() {
projectConfigPatchDefinitionBlockModel := &projectv1.ProjectConfigPatchDefinitionBlock{
Name: core.StringPtr("testString"),
Description: core.StringPtr("testString"),
Environment: core.StringPtr("testString"),
EnvironmentID: core.StringPtr("testString"),
Authorizations: projectConfigAuthModel,
ComplianceProfile: projectComplianceProfileModel,
LocatorID: core.StringPtr("testString"),
Expand Down Expand Up @@ -608,7 +608,7 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() {
})
})

Describe(`UndeployConfig - Destroy configuration resources`, func() {
Describe(`UndeployConfig - Undeploy configuration resources`, func() {
BeforeEach(func() {
shouldSkipTest()
})
Expand Down
Loading

0 comments on commit 2a73fd3

Please sign in to comment.