Skip to content

Commit

Permalink
Update synth.py to include Firestore Admin API
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidt-sebastian committed Mar 21, 2019
1 parent b734385 commit 8f3063a
Showing 1 changed file with 18 additions and 31 deletions.
49 changes: 18 additions & 31 deletions google-cloud-clients/google-cloud-firestore/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,21 @@

gapic = gcp.GAPICGenerator()

service = 'firestore'
version='v1beta1'

library = gapic.java_library(
service=service,
version='v1beta1',
config_path=f'/google/firestore/artman_firestore.yaml',
artman_output_name='')

s.copy(library / f'gapic-google-cloud-{service}-{version}/src', 'src')
s.copy(library / f'grpc-google-cloud-{service}-{version}/src', f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src')
s.copy(library / f'proto-google-cloud-{service}-{version}/src', f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src')

java.format_code('./src')
java.format_code(f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src')
java.format_code(f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src')

version='v1'
library = gapic.java_library(
service=service,
version='v1',
config_path=f'/google/firestore/artman_firestore_v1.yaml',
artman_output_name='')

s.copy(library / f'gapic-google-cloud-{service}-{version}/src', 'src')
s.copy(library / f'grpc-google-cloud-{service}-{version}/src', f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src')
s.copy(library / f'proto-google-cloud-{service}-{version}/src', f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src')

java.format_code('./src')
java.format_code(f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src')
java.format_code(f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src')
def generate_client(service, version, config_path):
library = gapic.java_library(
service=service,
version=version,
config_path=config_path,
artman_output_name='')

s.copy(library / f'gapic-google-cloud-{service}-{version}/src', 'src')
s.copy(library / f'grpc-google-cloud-{service}-{version}/src', f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src')
s.copy(library / f'proto-google-cloud-{service}-{version}/src', f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src')

java.format_code('./src')
java.format_code(f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src')
java.format_code(f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src')

generate_client('firestore-admin', 'v1', '/google/firestore/admin/artman_firestore_v1.yaml')
generate_client('firestore', 'v1beta1', '/google/firestore/artman_firestore.yaml')
generate_client('firestore', 'v1', '/google/firestore/artman_firestore_v1.yaml')

0 comments on commit 8f3063a

Please sign in to comment.