Skip to content

Commit

Permalink
Fix import formats of Firebase apps (GoogleCloudPlatform#7959)
Browse files Browse the repository at this point in the history
  • Loading branch information
rainshen49 authored and Shourya Singh committed May 25, 2023
1 parent 55149c7 commit 8380ba6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 13 deletions.
15 changes: 9 additions & 6 deletions mmv1/products/firebase/AndroidApp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
name: 'AndroidApp'
min_version: beta
base_url: projects/{{project}}/androidApps
self_link: '{{name}}'
self_link: 'projects/{{project}}/androidApps/{{app_id}}'
update_verb: :PATCH
update_mask: true
delete_verb: :POST
delete_url: '{{name}}:remove'
delete_url: 'projects/{{project}}/androidApps/{{app_id}}:remove'
description: |
A Google Cloud Firebase Android application instance
references: !ruby/object:Api::Resource::ReferenceLinks
Expand All @@ -46,12 +46,16 @@ async: !ruby/object:Api::OpAsync
message: 'message'
import_format:
[
'projects/{{project}}/androidApps/{{appId}}',
'androidApps/{{appId}}',
'{{appId}}',
'{{project}} projects/{{project}}/androidApps/{{app_id}}',
'projects/{{project}}/androidApps/{{app_id}}',
'androidApps/{{app_id}}',
'{{app_id}}',
]
autogen_async: true
skip_sweeper: true
identity:
- appId
- name
examples:
- !ruby/object:Provider::Terraform::Examples
name: 'firebase_android_app_basic'
Expand All @@ -78,7 +82,6 @@ virtual_fields:
serving traffic. Set to `DELETE` to delete the AndroidApp. Defaults to `DELETE`.
default_value: DELETE
custom_code: !ruby/object:Provider::Terraform::CustomCode
custom_import: templates/terraform/custom_import/self_link_as_name.erb
custom_delete: templates/terraform/custom_delete/firebase_app_deletion_policy.erb
properties:
- !ruby/object:Api::Type::String
Expand Down
13 changes: 10 additions & 3 deletions mmv1/products/firebase/AppleApp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
name: 'AppleApp'
min_version: beta
base_url: projects/{{project}}/iosApps
self_link: '{{name}}'
self_link: 'projects/{{project}}/iosApps/{{app_id}}'
update_verb: :PATCH
delete_verb: :POST
delete_url: 'projects/{{project}}/iosApps/{{app_id}}:remove'
Expand Down Expand Up @@ -45,9 +45,17 @@ async: !ruby/object:Api::OpAsync
path: 'error'
message: 'message'
import_format:
['projects/{{project}}/iosApps/{{appId}}', 'iosApps/{{appId}}', '{{appId}}']
[
'{{project}} projects/{{project}}/iosApps/{{app_id}}',
'projects/{{project}}/iosApps/{{app_id}}',
'iosApps/{{app_id}}',
'{{app_id}}'
]
autogen_async: true
skip_sweeper: true
identity:
- appId
- name
examples:
- !ruby/object:Provider::Terraform::Examples
name: 'firebase_apple_app_basic'
Expand Down Expand Up @@ -90,7 +98,6 @@ virtual_fields:
serving traffic. Set to `DELETE` to delete the Apple. Defaults to `DELETE`.
default_value: DELETE
custom_code: !ruby/object:Provider::Terraform::CustomCode
custom_import: templates/terraform/custom_import/self_link_as_name.erb
custom_delete: templates/terraform/custom_delete/firebase_app_deletion_policy.erb
properties:
- !ruby/object:Api::Type::String
Expand Down
16 changes: 12 additions & 4 deletions mmv1/products/firebase/WebApp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
name: 'WebApp'
min_version: beta
base_url: projects/{{project}}/webApps
self_link: '{{name}}'
self_link: 'projects/{{project}}/webApps/{{app_id}}'
update_verb: :PATCH
update_mask: true
delete_verb: :POST
delete_url: '{{name}}:remove'
delete_url: 'projects/{{project}}/webApps/{{app_id}}:remove'
description: |
A Google Cloud Firebase web application instance
references: !ruby/object:Api::Resource::ReferenceLinks
Expand All @@ -44,9 +44,18 @@ async: !ruby/object:Api::OpAsync
error: !ruby/object:Api::OpAsync::Error
path: 'error'
message: 'message'
import_format: ['{{project}} {{name}}']
import_format:
[
'{{project}} projects/{{project}}/webApps/{{app_id}}',
'projects/{{project}}/webApps/{{app_id}}',
'webApps/{{app_id}}',
'{{app_id}}',
]
autogen_async: true
skip_sweeper: true
identity:
- appId
- name
examples:
- !ruby/object:Provider::Terraform::Examples # TODO: https://github.com/hashicorp/terraform-provider-google/issues/14158
skip_vcr: true
Expand All @@ -73,7 +82,6 @@ virtual_fields:
serving traffic. Set to `DELETE` to delete the WebApp. Default to `ABANDON`
default_value: ABANDON
custom_code: !ruby/object:Provider::Terraform::CustomCode
custom_import: templates/terraform/custom_import/self_link_as_name.erb
custom_delete: templates/terraform/custom_delete/firebase_app_deletion_policy.erb
properties:
- !ruby/object:Api::Type::String
Expand Down

0 comments on commit 8380ba6

Please sign in to comment.