Skip to content

Commit

Permalink
Merge pull request GoogleCloudPlatform#1964 from justinsb/fix_openapi…
Browse files Browse the repository at this point in the history
…_generation

fix: better handling for http proto annotations
  • Loading branch information
google-oss-prow[bot] authored Jun 6, 2024
2 parents 040ef44 + 55db32e commit a26493b
Show file tree
Hide file tree
Showing 11 changed files with 8,354 additions and 7,568 deletions.
73 changes: 43 additions & 30 deletions mockgcp/apis/mockgcp/cloud/bigquery/v2/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -515,12 +515,13 @@ message Dataset {
optional LinkedDatasetSource linked_dataset_source = 20 [json_name="linkedDatasetSource"];
optional string location = 21 [json_name="location"];
optional int64 max_time_travel_hours = 22 [json_name="maxTimeTravelHours"];
optional bool satisfies_pzi = 23 [json_name="satisfiesPzi"];
optional bool satisfies_pzs = 24 [json_name="satisfiesPzs"];
optional string self_link = 25 [json_name="selfLink"];
optional string storage_billing_model = 26 [json_name="storageBillingModel"];
repeated DatasetTags tags = 27 [json_name="tags"];
optional string type = 28 [json_name="type"];
optional RestrictionConfig restrictions = 23 [json_name="restrictions"];
optional bool satisfies_pzi = 24 [json_name="satisfiesPzi"];
optional bool satisfies_pzs = 25 [json_name="satisfiesPzs"];
optional string self_link = 26 [json_name="selfLink"];
optional string storage_billing_model = 27 [json_name="storageBillingModel"];
repeated DatasetTags tags = 28 [json_name="tags"];
optional string type = 29 [json_name="type"];
}
message DatasetAccessEntry {
optional DatasetReference dataset = 1 [json_name="dataset"];
Expand Down Expand Up @@ -553,11 +554,13 @@ message DestinationTableProperties {
}
message DifferentialPrivacyPolicy {
optional double delta_budget = 1 [json_name="deltaBudget"];
optional double delta_per_query = 2 [json_name="deltaPerQuery"];
optional double epsilon_budget = 3 [json_name="epsilonBudget"];
optional double max_epsilon_per_query = 4 [json_name="maxEpsilonPerQuery"];
optional int64 max_groups_contributed = 5 [json_name="maxGroupsContributed"];
optional string privacy_unit_column = 6 [json_name="privacyUnitColumn"];
optional double delta_budget_remaining = 2 [json_name="deltaBudgetRemaining"];
optional double delta_per_query = 3 [json_name="deltaPerQuery"];
optional double epsilon_budget = 4 [json_name="epsilonBudget"];
optional double epsilon_budget_remaining = 5 [json_name="epsilonBudgetRemaining"];
optional double max_epsilon_per_query = 6 [json_name="maxEpsilonPerQuery"];
optional int64 max_groups_contributed = 7 [json_name="maxGroupsContributed"];
optional string privacy_unit_column = 8 [json_name="privacyUnitColumn"];
}
message DimensionalityReductionMetrics {
optional double total_explained_variance_ratio = 1 [json_name="totalExplainedVarianceRatio"];
Expand Down Expand Up @@ -699,6 +702,9 @@ message FeatureValue {
optional string feature_column = 2 [json_name="featureColumn"];
optional double numerical_value = 3 [json_name="numericalValue"];
}
message ForeignTypeInfo {
optional string type_system = 1 [json_name="typeSystem"];
}
message GetIamPolicyRequest {
optional GetPolicyOptions options = 1 [json_name="options"];
}
Expand Down Expand Up @@ -1173,6 +1179,7 @@ message MultiClassClassificationMetrics {
message ParquetOptions {
optional bool enable_list_inference = 1 [json_name="enableListInference"];
optional bool enum_as_string = 2 [json_name="enumAsString"];
optional string map_target_type = 3 [json_name="mapTargetType"];
}
message PartitionSkew {
repeated SkewSource skew_sources = 1 [json_name="skewSources"];
Expand Down Expand Up @@ -1334,6 +1341,9 @@ message RemoteModelInfo {
optional string remote_service_type = 5 [json_name="remoteServiceType"];
optional string speech_recognizer = 6 [json_name="speechRecognizer"];
}
message RestrictionConfig {
optional string type = 1 [json_name="type"];
}
message Routine {
repeated Argument arguments = 1 [json_name="arguments"];
optional int64 creation_time = 2 [json_name="creationTime"];
Expand Down Expand Up @@ -1529,16 +1539,17 @@ message Table {
repeated TableReference replicas = 37 [json_name="replicas"];
optional bool require_partition_filter = 38 [json_name="requirePartitionFilter"];
map<string, string> resource_tags = 39 [json_name="resourceTags"];
optional TableSchema schema = 40 [json_name="schema"];
optional string self_link = 41 [json_name="selfLink"];
optional SnapshotDefinition snapshot_definition = 42 [json_name="snapshotDefinition"];
optional Streamingbuffer streaming_buffer = 43 [json_name="streamingBuffer"];
optional TableConstraints table_constraints = 44 [json_name="tableConstraints"];
optional TableReference table_reference = 45 [json_name="tableReference"];
optional TableReplicationInfo table_replication_info = 46 [json_name="tableReplicationInfo"];
optional TimePartitioning time_partitioning = 47 [json_name="timePartitioning"];
optional string type = 48 [json_name="type"];
optional ViewDefinition view = 49 [json_name="view"];
optional RestrictionConfig restrictions = 40 [json_name="restrictions"];
optional TableSchema schema = 41 [json_name="schema"];
optional string self_link = 42 [json_name="selfLink"];
optional SnapshotDefinition snapshot_definition = 43 [json_name="snapshotDefinition"];
optional Streamingbuffer streaming_buffer = 44 [json_name="streamingBuffer"];
optional TableConstraints table_constraints = 45 [json_name="tableConstraints"];
optional TableReference table_reference = 46 [json_name="tableReference"];
optional TableReplicationInfo table_replication_info = 47 [json_name="tableReplicationInfo"];
optional TimePartitioning time_partitioning = 48 [json_name="timePartitioning"];
optional string type = 49 [json_name="type"];
optional ViewDefinition view = 50 [json_name="view"];
}
message TableCell {
optional .google.protobuf.Any v = 1 [json_name="v"];
Expand Down Expand Up @@ -1606,15 +1617,16 @@ message TableFieldSchema {
optional string default_value_expression = 3 [json_name="defaultValueExpression"];
optional string description = 4 [json_name="description"];
repeated TableFieldSchema fields = 5 [json_name="fields"];
optional int64 max_length = 6 [json_name="maxLength"];
optional string mode = 7 [json_name="mode"];
optional string name = 8 [json_name="name"];
optional TableFieldSchemaPolicyTags policy_tags = 9 [json_name="policyTags"];
optional int64 precision = 10 [json_name="precision"];
optional TableFieldSchemaRangeElementType range_element_type = 11 [json_name="rangeElementType"];
optional string rounding_mode = 12 [json_name="roundingMode"];
optional int64 scale = 13 [json_name="scale"];
optional string type = 14 [json_name="type"];
optional string foreign_type_definition = 6 [json_name="foreignTypeDefinition"];
optional int64 max_length = 7 [json_name="maxLength"];
optional string mode = 8 [json_name="mode"];
optional string name = 9 [json_name="name"];
optional TableFieldSchemaPolicyTags policy_tags = 10 [json_name="policyTags"];
optional int64 precision = 11 [json_name="precision"];
optional TableFieldSchemaRangeElementType range_element_type = 12 [json_name="rangeElementType"];
optional string rounding_mode = 13 [json_name="roundingMode"];
optional int64 scale = 14 [json_name="scale"];
optional string type = 15 [json_name="type"];
}
message View {
optional PrivacyPolicy privacy_policy = 1 [json_name="privacyPolicy"];
Expand Down Expand Up @@ -1665,6 +1677,7 @@ message TableRow {
}
message TableSchema {
repeated TableFieldSchema fields = 1 [json_name="fields"];
optional ForeignTypeInfo foreign_type_info = 2 [json_name="foreignTypeInfo"];
}
message TestIamPermissionsRequest {
repeated string permissions = 1 [json_name="permissions"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,35 @@ option go_package = "cloud.google.com/go/servicenetworking/apiv1/servicenetworki
service ServicesServer {
rpc AddSubnetworkService(AddSubnetworkServiceRequest) returns (.google.longrunning.Operation){
option (google.api.http) = {
post: "/v1/{parent=*}:addSubnetwork"
post: "/v1/{parent=services/*/*/*}:addSubnetwork"
body: "service"
};
}
;
rpc DisableVpcServiceControlsService(DisableVpcServiceControlsServiceRequest) returns (.google.longrunning.Operation){
option (google.api.http) = {
patch: "/v1/{parent=*}:disableVpcServiceControls"
patch: "/v1/{parent=services/*}:disableVpcServiceControls"
body: "service"
};
}
;
rpc EnableVpcServiceControlsService(EnableVpcServiceControlsServiceRequest) returns (.google.longrunning.Operation){
option (google.api.http) = {
patch: "/v1/{parent=*}:enableVpcServiceControls"
patch: "/v1/{parent=services/*}:enableVpcServiceControls"
body: "service"
};
}
;
rpc SearchRangeService(SearchRangeServiceRequest) returns (.google.longrunning.Operation){
option (google.api.http) = {
post: "/v1/{parent=*}:searchRange"
post: "/v1/{parent=services/*}:searchRange"
body: "service"
};
}
;
rpc ValidateService(ValidateServiceRequest) returns (ValidateConsumerConfigResponse){
option (google.api.http) = {
post: "/v1/{parent=*}:validate"
post: "/v1/{parent=services/*}:validate"
body: "service"
};
}
Expand All @@ -59,27 +59,27 @@ service ServicesServer {
service ServicesConnectionsServer {
rpc CreateServicesConnection(CreateServicesConnectionRequest) returns (.google.longrunning.Operation){
option (google.api.http) = {
post: "/v1/{parent=*}/connections"
post: "/v1/{parent=services/*}/connections"
body: "services_connection"
};
}
;
rpc DeleteConnectionServicesConnection(DeleteConnectionServicesConnectionRequest) returns (.google.longrunning.Operation){
option (google.api.http) = {
post: "/v1/{name=*}"
post: "/v1/{name=services/*/connections/*}"
body: "services_connection"
};
}
;
rpc ListServicesConnections(ListServicesConnectionsRequest) returns (ListConnectionsResponse){
option (google.api.http) = {
get: "/v1/{parent=*}/connections"
get: "/v1/{parent=services/*}/connections"
};
}
;
rpc PatchServicesConnection(PatchServicesConnectionRequest) returns (.google.longrunning.Operation){
option (google.api.http) = {
patch: "/v1/{name=*}"
patch: "/v1/{name=services/*/connections/*}"
body: "services_connection"
};
}
Expand All @@ -88,33 +88,33 @@ service ServicesConnectionsServer {
service ServicesDnsRecordSetsServer {
rpc AddServicesDnsRecordSet(AddServicesDnsRecordSetRequest) returns (.google.longrunning.Operation){
option (google.api.http) = {
post: "/v1/{parent=*}/dnsRecordSets:add"
post: "/v1/{parent=services/*}/dnsRecordSets:add"
body: "services_dns_record_set"
};
}
;
rpc GetServicesDnsRecordSet(GetServicesDnsRecordSetRequest) returns (DnsRecordSet){
option (google.api.http) = {
get: "/v1/{parent=*}/dnsRecordSets:get"
get: "/v1/{parent=services/*}/dnsRecordSets:get"
};
}
;
rpc ListServicesDnsRecordSets(ListServicesDnsRecordSetsRequest) returns (ListDnsRecordSetsResponse){
option (google.api.http) = {
get: "/v1/{parent=*}/dnsRecordSets:list"
get: "/v1/{parent=services/*}/dnsRecordSets:list"
};
}
;
rpc DeleteServicesDnsRecordSet(DeleteServicesDnsRecordSetRequest) returns (.google.longrunning.Operation){
option (google.api.http) = {
post: "/v1/{parent=*}/dnsRecordSets:remove"
post: "/v1/{parent=services/*}/dnsRecordSets:remove"
body: "services_dns_record_set"
};
}
;
rpc UpdateServicesDnsRecordSet(UpdateServicesDnsRecordSetRequest) returns (.google.longrunning.Operation){
option (google.api.http) = {
post: "/v1/{parent=*}/dnsRecordSets:update"
post: "/v1/{parent=services/*}/dnsRecordSets:update"
body: "services_dns_record_set"
};
}
Expand All @@ -123,14 +123,14 @@ service ServicesDnsRecordSetsServer {
service ServicesDnsZonesServer {
rpc AddServicesDnsZone(AddServicesDnsZoneRequest) returns (.google.longrunning.Operation){
option (google.api.http) = {
post: "/v1/{parent=*}/dnsZones:add"
post: "/v1/{parent=services/*}/dnsZones:add"
body: "services_dns_zone"
};
}
;
rpc DeleteServicesDnsZone(DeleteServicesDnsZoneRequest) returns (.google.longrunning.Operation){
option (google.api.http) = {
post: "/v1/{parent=*}/dnsZones:remove"
post: "/v1/{parent=services/*}/dnsZones:remove"
body: "services_dns_zone"
};
}
Expand All @@ -143,19 +143,19 @@ service ServicesProjectsGlobalServer {
service ServicesProjectsGlobalNetworksServer {
rpc GetServicesProjectsGlobalNetwork(GetServicesProjectsGlobalNetworkRequest) returns (ConsumerConfig){
option (google.api.http) = {
get: "/v1/{name=*}"
get: "/v1/{name=services/*/projects/*/global/networks/*}"
};
}
;
rpc GetVpcServiceControlsServicesProjectsGlobalNetwork(GetVpcServiceControlsServicesProjectsGlobalNetworkRequest) returns (VpcServiceControls){
option (google.api.http) = {
get: "/v1/{name=*}/vpcServiceControls"
get: "/v1/{name=services/*/projects/*/global/networks/*}/vpcServiceControls"
};
}
;
rpc UpdateConsumerConfigServicesProjectsGlobalNetwork(UpdateConsumerConfigServicesProjectsGlobalNetworkRequest) returns (.google.longrunning.Operation){
option (google.api.http) = {
patch: "/v1/{parent=*}:updateConsumerConfig"
patch: "/v1/{parent=services/*/projects/*/global/networks/*}:updateConsumerConfig"
body: "services_projects_global_network"
};
}
Expand All @@ -164,42 +164,42 @@ service ServicesProjectsGlobalNetworksServer {
service ServicesProjectsGlobalNetworksDnsZonesServer {
rpc GetServicesProjectsGlobalNetworksDnsZone(GetServicesProjectsGlobalNetworksDnsZoneRequest) returns (GetDnsZoneResponse){
option (google.api.http) = {
get: "/v1/{name=*}"
get: "/v1/{name=services/*/projects/*/global/networks/*/dnsZones/*}"
};
}
;
rpc ListServicesProjectsGlobalNetworksDnsZones(ListServicesProjectsGlobalNetworksDnsZonesRequest) returns (ListDnsZonesResponse){
option (google.api.http) = {
get: "/v1/{parent=*}/dnsZones:list"
get: "/v1/{parent=services/*/projects/*/global/networks/*}/dnsZones:list"
};
}
;
}
service ServicesProjectsGlobalNetworksPeeredDnsDomainsServer {
rpc CreateServicesProjectsGlobalNetworksPeeredDnsDomain(CreateServicesProjectsGlobalNetworksPeeredDnsDomainRequest) returns (.google.longrunning.Operation){
option (google.api.http) = {
post: "/v1/{parent=*}/peeredDnsDomains"
post: "/v1/{parent=services/*/projects/*/global/networks/*}/peeredDnsDomains"
body: "services_projects_global_networks_peered_dns_domain"
};
}
;
rpc DeleteServicesProjectsGlobalNetworksPeeredDnsDomain(DeleteServicesProjectsGlobalNetworksPeeredDnsDomainRequest) returns (.google.longrunning.Operation){
option (google.api.http) = {
delete: "/v1/{name=*}"
delete: "/v1/{name=services/*/projects/*/global/networks/*/peeredDnsDomains/*}"
};
}
;
rpc ListServicesProjectsGlobalNetworksPeeredDnsDomains(ListServicesProjectsGlobalNetworksPeeredDnsDomainsRequest) returns (ListPeeredDnsDomainsResponse){
option (google.api.http) = {
get: "/v1/{parent=*}/peeredDnsDomains"
get: "/v1/{parent=services/*/projects/*/global/networks/*}/peeredDnsDomains"
};
}
;
}
service ServicesRolesServer {
rpc AddServicesRole(AddServicesRoleRequest) returns (.google.longrunning.Operation){
option (google.api.http) = {
post: "/v1/{parent=*}/roles:add"
post: "/v1/{parent=services/*}/roles:add"
body: "services_role"
};
}
Expand Down
26 changes: 25 additions & 1 deletion mockgcp/apis/mockgcp/storage/v1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
syntax = "proto2";
package google.cloud.storage.v1;
import "google/api/annotations.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
option go_package = "cloud.google.com/go/storage/apiv1/storagepb;storagepb";
Expand Down Expand Up @@ -119,6 +119,12 @@ service BucketsServer {
get: "/storage/v1/b/{name}"
};
}
;
rpc GetStorageLayoutBucket(GetStorageLayoutBucketRequest) returns (BucketStorageLayout){
option (google.api.http) = {
get: "/storage/v1/b/{name}/storageLayout"
};
}
;
rpc InsertBucket(InsertBucketRequest) returns (Bucket){
option (google.api.http) = {
Expand Down Expand Up @@ -621,6 +627,20 @@ message BucketAccessControls {
repeated BucketAccessControl items = 1 [json_name="items"];
optional string kind = 2 [json_name="kind"];
}
message BucketStorageLayoutCustomPlacementConfig {
repeated string data_locations = 1 [json_name="dataLocations"];
}
message BucketStorageLayoutHierarchicalNamespace {
optional bool enabled = 1 [json_name="enabled"];
}
message BucketStorageLayout {
optional string bucket = 1 [json_name="bucket"];
optional BucketStorageLayoutCustomPlacementConfig custom_placement_config = 2 [json_name="customPlacementConfig"];
optional BucketStorageLayoutHierarchicalNamespace hierarchical_namespace = 3 [json_name="hierarchicalNamespace"];
optional string kind = 4 [json_name="kind"];
optional string location = 5 [json_name="location"];
optional string location_type = 6 [json_name="locationType"];
}
message Buckets {
repeated Bucket items = 1 [json_name="items"];
optional string kind = 2 [json_name="kind"];
Expand Down Expand Up @@ -931,6 +951,10 @@ message GetBucketRequest {
optional string projection = 4;
optional string user_project = 5;
}
message GetStorageLayoutBucketRequest {
optional string name = 1;
optional string prefix = 2;
}
message InsertBucketRequest {
optional bool enable_object_retention = 1;
optional string predefined_acl = 2;
Expand Down
Loading

0 comments on commit a26493b

Please sign in to comment.