@@ -61,6 +61,13 @@ func resourceApigeeOrganization() *schema.Resource {
6161See [Getting started with the Service Networking API](https://cloud.google.com/service-infrastructure/docs/service-networking/getting-started).
6262Valid only when 'RuntimeType' is set to CLOUD. The value can be updated only when there are no runtime instances. For example: "default".` ,
6363 },
64+ "billing_type" : {
65+ Type : schema .TypeString ,
66+ Computed : true ,
67+ Optional : true ,
68+ ForceNew : true ,
69+ Description : `Billing type of the Apigee organization. See [Apigee pricing](https://cloud.google.com/apigee/pricing).` ,
70+ },
6471 "description" : {
6572 Type : schema .TypeString ,
6673 Optional : true ,
@@ -148,6 +155,12 @@ func resourceApigeeOrganizationCreate(d *schema.ResourceData, meta interface{})
148155 } else if v , ok := d .GetOkExists ("runtime_type" ); ! isEmptyValue (reflect .ValueOf (runtimeTypeProp )) && (ok || ! reflect .DeepEqual (v , runtimeTypeProp )) {
149156 obj ["runtimeType" ] = runtimeTypeProp
150157 }
158+ billingTypeProp , err := expandApigeeOrganizationBillingType (d .Get ("billing_type" ), d , config )
159+ if err != nil {
160+ return err
161+ } else if v , ok := d .GetOkExists ("billing_type" ); ! isEmptyValue (reflect .ValueOf (billingTypeProp )) && (ok || ! reflect .DeepEqual (v , billingTypeProp )) {
162+ obj ["billingType" ] = billingTypeProp
163+ }
151164 runtimeDatabaseEncryptionKeyNameProp , err := expandApigeeOrganizationRuntimeDatabaseEncryptionKeyName (d .Get ("runtime_database_encryption_key_name" ), d , config )
152165 if err != nil {
153166 return err
@@ -258,6 +271,9 @@ func resourceApigeeOrganizationRead(d *schema.ResourceData, meta interface{}) er
258271 if err := d .Set ("subscription_type" , flattenApigeeOrganizationSubscriptionType (res ["subscriptionType" ], d , config )); err != nil {
259272 return fmt .Errorf ("Error reading Organization: %s" , err )
260273 }
274+ if err := d .Set ("billing_type" , flattenApigeeOrganizationBillingType (res ["billingType" ], d , config )); err != nil {
275+ return fmt .Errorf ("Error reading Organization: %s" , err )
276+ }
261277 if err := d .Set ("ca_certificate" , flattenApigeeOrganizationCaCertificate (res ["caCertificate" ], d , config )); err != nil {
262278 return fmt .Errorf ("Error reading Organization: %s" , err )
263279 }
@@ -308,6 +324,12 @@ func resourceApigeeOrganizationUpdate(d *schema.ResourceData, meta interface{})
308324 } else if v , ok := d .GetOkExists ("runtime_type" ); ! isEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , runtimeTypeProp )) {
309325 obj ["runtimeType" ] = runtimeTypeProp
310326 }
327+ billingTypeProp , err := expandApigeeOrganizationBillingType (d .Get ("billing_type" ), d , config )
328+ if err != nil {
329+ return err
330+ } else if v , ok := d .GetOkExists ("billing_type" ); ! isEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , billingTypeProp )) {
331+ obj ["billingType" ] = billingTypeProp
332+ }
311333 runtimeDatabaseEncryptionKeyNameProp , err := expandApigeeOrganizationRuntimeDatabaseEncryptionKeyName (d .Get ("runtime_database_encryption_key_name" ), d , config )
312334 if err != nil {
313335 return err
@@ -461,6 +483,10 @@ func flattenApigeeOrganizationSubscriptionType(v interface{}, d *schema.Resource
461483 return v
462484}
463485
486+ func flattenApigeeOrganizationBillingType (v interface {}, d * schema.ResourceData , config * Config ) interface {} {
487+ return v
488+ }
489+
464490func flattenApigeeOrganizationCaCertificate (v interface {}, d * schema.ResourceData , config * Config ) interface {} {
465491 return v
466492}
@@ -489,6 +515,10 @@ func expandApigeeOrganizationRuntimeType(v interface{}, d TerraformResourceData,
489515 return v , nil
490516}
491517
518+ func expandApigeeOrganizationBillingType (v interface {}, d TerraformResourceData , config * Config ) (interface {}, error ) {
519+ return v , nil
520+ }
521+
492522func expandApigeeOrganizationRuntimeDatabaseEncryptionKeyName (v interface {}, d TerraformResourceData , config * Config ) (interface {}, error ) {
493523 return v , nil
494524}
0 commit comments