Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing field in datasources for entitlements #329

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/data-sources/directory_entitlements.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ data "btp_directory_entitlements" "all" {

Read-Only:

- `category` (String) The current state of the entitlement. Possible values are:

| value | description |
| --- | --- |
| `PLATFORM` | A service required for using a specific platform; for example, Application Runtime is required for the Cloud Foundry platform. |
| `SERVICE` | A commercial or technical service. that has a numeric quota (amount) when entitled or assigned to a resource. When assigning entitlements of this type, use the 'amount' option. |
| `ELASTIC_SERVICE` | A commercial or technical service that has no numeric quota (amount) when entitled or assigned to a resource. Generally this type of service can be as many times as needed when enabled, but may in some cases be restricted by the service owner. |
| `ELASTIC_LIMITED` | An elastic service that can be enabled for only one subaccount per global account. |
| `APPLICATION` | A multitenant application to which consumers can subscribe. As opposed to applications defined as a 'QUOTA_BASED_APPLICATION', these applications do not have a numeric quota and are simply enabled or disabled as entitlements per subaccount. |
| `QUOTA_BASED_APPLICATION` | A multitenant application to which consumers can subscribe. As opposed to applications defined as 'APPLICATION', these applications have an numeric quota that limits consumer usage of the subscribed application per subaccount. |
| `ENVIRONMENT` | An environment service; for example, Cloud Foundry. |
- `plan_description` (String) The description of the entitled service plan.
- `plan_display_name` (String) The display name of the entitled service plan.
- `plan_name` (String) The name of the entitled service plan.
Expand Down
11 changes: 11 additions & 0 deletions docs/data-sources/globalaccount_entitlements.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ data "btp_globalaccount_entitlements" "all" {}

Read-Only:

- `category` (String) The current state of the entitlement. Possible values are:

| value | description |
| --- | --- |
| `PLATFORM` | A service required for using a specific platform; for example, Application Runtime is required for the Cloud Foundry platform. |
| `SERVICE` | A commercial or technical service. that has a numeric quota (amount) when entitled or assigned to a resource. When assigning entitlements of this type, use the 'amount' option. |
| `ELASTIC_SERVICE` | A commercial or technical service that has no numeric quota (amount) when entitled or assigned to a resource. Generally this type of service can be as many times as needed when enabled, but may in some cases be restricted by the service owner. |
| `ELASTIC_LIMITED` | An elastic service that can be enabled for only one subaccount per global account. |
| `APPLICATION` | A multitenant application to which consumers can subscribe. As opposed to applications defined as a 'QUOTA_BASED_APPLICATION', these applications do not have a numeric quota and are simply enabled or disabled as entitlements per subaccount. |
| `QUOTA_BASED_APPLICATION` | A multitenant application to which consumers can subscribe. As opposed to applications defined as 'APPLICATION', these applications have an numeric quota that limits consumer usage of the subscribed application per subaccount. |
| `ENVIRONMENT` | An environment service; for example, Cloud Foundry. |
- `plan_description` (String) The description of the entitled service plan.
- `plan_display_name` (String) The display name of the entitled service plan.
- `plan_name` (String) The name of the entitled service plan.
Expand Down
11 changes: 11 additions & 0 deletions docs/data-sources/subaccount_entitlements.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ data "btp_subaccount_entitlements" "all" {

Read-Only:

- `category` (String) The current state of the entitlement. Possible values are:

| value | description |
| --- | --- |
| `PLATFORM` | A service required for using a specific platform; for example, Application Runtime is required for the Cloud Foundry platform. |
| `SERVICE` | A commercial or technical service. that has a numeric quota (amount) when entitled or assigned to a resource. When assigning entitlements of this type, use the 'amount' option. |
| `ELASTIC_SERVICE` | A commercial or technical service that has no numeric quota (amount) when entitled or assigned to a resource. Generally this type of service can be as many times as needed when enabled, but may in some cases be restricted by the service owner. |
| `ELASTIC_LIMITED` | An elastic service that can be enabled for only one subaccount per global account. |
| `APPLICATION` | A multitenant application to which consumers can subscribe. As opposed to applications defined as a 'QUOTA_BASED_APPLICATION', these applications do not have a numeric quota and are simply enabled or disabled as entitlements per subaccount. |
| `QUOTA_BASED_APPLICATION` | A multitenant application to which consumers can subscribe. As opposed to applications defined as 'APPLICATION', these applications have an numeric quota that limits consumer usage of the subscribed application per subaccount. |
| `ENVIRONMENT` | An environment service; for example, Cloud Foundry. |
- `plan_description` (String) The description of the entitled service plan.
- `plan_display_name` (String) The display name of the entitled service plan.
- `plan_name` (String) The name of the entitled service plan.
Expand Down
14 changes: 14 additions & 0 deletions internal/provider/datasource_directory_entitlements.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,19 @@ To view all the resources that a directory and its subdirectories and subaccount
MarkdownDescription: "The quota, which is not used.",
Computed: true,
},
"category": schema.StringAttribute{
MarkdownDescription: "The current state of the entitlement. Possible values are: \n " +
getFormattedValueAsTableRow("value", "description") +
getFormattedValueAsTableRow("---", "---") +
getFormattedValueAsTableRow("`PLATFORM`", " A service required for using a specific platform; for example, Application Runtime is required for the Cloud Foundry platform.") +
getFormattedValueAsTableRow("`SERVICE`", "A commercial or technical service. that has a numeric quota (amount) when entitled or assigned to a resource. When assigning entitlements of this type, use the 'amount' option.") +
getFormattedValueAsTableRow("`ELASTIC_SERVICE`", "A commercial or technical service that has no numeric quota (amount) when entitled or assigned to a resource. Generally this type of service can be as many times as needed when enabled, but may in some cases be restricted by the service owner.") +
getFormattedValueAsTableRow("`ELASTIC_LIMITED`", "An elastic service that can be enabled for only one subaccount per global account.") +
getFormattedValueAsTableRow("`APPLICATION`", "A multitenant application to which consumers can subscribe. As opposed to applications defined as a 'QUOTA_BASED_APPLICATION', these applications do not have a numeric quota and are simply enabled or disabled as entitlements per subaccount.") +
getFormattedValueAsTableRow("`QUOTA_BASED_APPLICATION`", "A multitenant application to which consumers can subscribe. As opposed to applications defined as 'APPLICATION', these applications have an numeric quota that limits consumer usage of the subscribed application per subaccount.") +
getFormattedValueAsTableRow("`ENVIRONMENT`", " An environment service; for example, Cloud Foundry."),
Computed: true,
},
},
},
Computed: true,
Expand Down Expand Up @@ -128,6 +141,7 @@ func (ds *directoryEntitlementsDataSource) Read(ctx context.Context, req datasou
PlanDescription: types.StringValue(servicePlan.Description),
QuotaAssigned: types.Float64Value(servicePlan.Amount),
QuotaRemaining: types.Float64Value(servicePlan.RemainingAmount),
Category: types.StringValue(servicePlan.Category),
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions internal/provider/datasource_globalaccount_entitlements.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type entitledService struct {
PlanDescription types.String `tfsdk:"plan_description"`
QuotaAssigned types.Float64 `tfsdk:"quota_assigned"`
QuotaRemaining types.Float64 `tfsdk:"quota_remaining"`
Category types.String `tfsdk:"category"`
}

func entitledServiceType() map[string]attr.Type {
Expand All @@ -35,6 +36,7 @@ func entitledServiceType() map[string]attr.Type {
"plan_description": types.StringType,
"quota_assigned": types.Float64Type,
"quota_remaining": types.Float64Type,
"category": types.StringType,
}
}

Expand Down Expand Up @@ -105,6 +107,19 @@ To view all the resources a global account:
MarkdownDescription: "The quota, which is not used.",
Computed: true,
},
"category": schema.StringAttribute{
MarkdownDescription: "The current state of the entitlement. Possible values are: \n " +
getFormattedValueAsTableRow("value", "description") +
getFormattedValueAsTableRow("---", "---") +
getFormattedValueAsTableRow("`PLATFORM`", " A service required for using a specific platform; for example, Application Runtime is required for the Cloud Foundry platform.") +
getFormattedValueAsTableRow("`SERVICE`", "A commercial or technical service. that has a numeric quota (amount) when entitled or assigned to a resource. When assigning entitlements of this type, use the 'amount' option.") +
getFormattedValueAsTableRow("`ELASTIC_SERVICE`", "A commercial or technical service that has no numeric quota (amount) when entitled or assigned to a resource. Generally this type of service can be as many times as needed when enabled, but may in some cases be restricted by the service owner.") +
getFormattedValueAsTableRow("`ELASTIC_LIMITED`", "An elastic service that can be enabled for only one subaccount per global account.") +
getFormattedValueAsTableRow("`APPLICATION`", "A multitenant application to which consumers can subscribe. As opposed to applications defined as a 'QUOTA_BASED_APPLICATION', these applications do not have a numeric quota and are simply enabled or disabled as entitlements per subaccount.") +
getFormattedValueAsTableRow("`QUOTA_BASED_APPLICATION`", "A multitenant application to which consumers can subscribe. As opposed to applications defined as 'APPLICATION', these applications have an numeric quota that limits consumer usage of the subscribed application per subaccount.") +
getFormattedValueAsTableRow("`ENVIRONMENT`", " An environment service; for example, Cloud Foundry."),
Computed: true,
},
},
},
Computed: true,
Expand Down Expand Up @@ -141,6 +156,7 @@ func (ds *globalaccountEntitlementsDataSource) Read(ctx context.Context, req dat
PlanDescription: types.StringValue(servicePlan.Description),
QuotaAssigned: types.Float64Value(servicePlan.Amount),
QuotaRemaining: types.Float64Value(servicePlan.RemainingAmount),
Category: types.StringValue(servicePlan.Category),
}
}
}
Expand Down
14 changes: 14 additions & 0 deletions internal/provider/datasource_subaccount_entitlements.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@ To get all entitlements and quota assigned to a specific subaccount:
MarkdownDescription: "The quota, which is not used.",
Computed: true,
},
"category": schema.StringAttribute{
MarkdownDescription: "The current state of the entitlement. Possible values are: \n " +
getFormattedValueAsTableRow("value", "description") +
getFormattedValueAsTableRow("---", "---") +
getFormattedValueAsTableRow("`PLATFORM`", " A service required for using a specific platform; for example, Application Runtime is required for the Cloud Foundry platform.") +
getFormattedValueAsTableRow("`SERVICE`", "A commercial or technical service. that has a numeric quota (amount) when entitled or assigned to a resource. When assigning entitlements of this type, use the 'amount' option.") +
getFormattedValueAsTableRow("`ELASTIC_SERVICE`", "A commercial or technical service that has no numeric quota (amount) when entitled or assigned to a resource. Generally this type of service can be as many times as needed when enabled, but may in some cases be restricted by the service owner.") +
getFormattedValueAsTableRow("`ELASTIC_LIMITED`", "An elastic service that can be enabled for only one subaccount per global account.") +
getFormattedValueAsTableRow("`APPLICATION`", "A multitenant application to which consumers can subscribe. As opposed to applications defined as a 'QUOTA_BASED_APPLICATION', these applications do not have a numeric quota and are simply enabled or disabled as entitlements per subaccount.") +
getFormattedValueAsTableRow("`QUOTA_BASED_APPLICATION`", "A multitenant application to which consumers can subscribe. As opposed to applications defined as 'APPLICATION', these applications have an numeric quota that limits consumer usage of the subscribed application per subaccount.") +
getFormattedValueAsTableRow("`ENVIRONMENT`", " An environment service; for example, Cloud Foundry."),
Computed: true,
},
},
},
Computed: true,
Expand Down Expand Up @@ -126,6 +139,7 @@ func (ds *subaccountEntitlementsDataSource) Read(ctx context.Context, req dataso
PlanDescription: types.StringValue(servicePlan.Description),
QuotaAssigned: types.Float64Value(servicePlan.Amount),
QuotaRemaining: types.Float64Value(servicePlan.RemainingAmount),
Category: types.StringValue(servicePlan.Category),
}
}
}
Expand Down
Loading