From 92bd3ac9322801759efc400a6e27ed1a48460a7d Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 12 Jun 2026 20:07:35 +0000 Subject: [PATCH 01/13] docs(api): add proto-first AIP contract + buf/OpenAPI tooling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Define the online "my festival" API as Protocol Buffers following Google's AIPs, as the source of truth for the ratings/recommendations endpoints. An OpenAPI v3 doc is generated from it via a buf BSR remote plugin. - proto/cambeerfestival/myfestival/v1: Rating/RatingSummary, Recommendation/RecommendationSummary resources and MyFestivalService with google.api.http annotations. - Resource-oriented design: nested resource names, Update+allow_missing upsert (AIP-134), bodyless Delete (AIP-135), paginated List of summaries (AIP-158), field_behavior + resource annotations. - buf.yaml (googleapis dep, AIP-aware lint) and buf.gen.yaml (gnostic OpenAPI remote plugin); buf added to the dev mise env with proto:lint / format / dep-update / generate tasks. See proto/README.md. Contract only — buf lint/build and OpenAPI generation, plus reworking the worker to conform, are pending network access to buf.build. --- mise.dev.toml | 24 ++ proto/README.md | 50 ++++ proto/buf.gen.yaml | 10 + proto/buf.yaml | 17 ++ .../myfestival/v1/my_festival_service.proto | 246 ++++++++++++++++++ .../myfestival/v1/rating.proto | 53 ++++ .../myfestival/v1/recommendation.proto | 53 ++++ 7 files changed, 453 insertions(+) create mode 100644 proto/README.md create mode 100644 proto/buf.gen.yaml create mode 100644 proto/buf.yaml create mode 100644 proto/cambeerfestival/myfestival/v1/my_festival_service.proto create mode 100644 proto/cambeerfestival/myfestival/v1/rating.proto create mode 100644 proto/cambeerfestival/myfestival/v1/recommendation.proto diff --git a/mise.dev.toml b/mise.dev.toml index 77d48bce..7f8101e5 100644 --- a/mise.dev.toml +++ b/mise.dev.toml @@ -17,6 +17,30 @@ [tools] watchexec = "2.5.1" +# --- Protobuf / OpenAPI (API contract is proto-first; see proto/README.md) --- +# buf is provided by the base mise.toml tools. The proto tasks require network +# access to buf.build (BSR deps + remote OpenAPI plugin). + +[tasks."proto:lint"] +description = "Lint the protobuf API contract" +dir = "proto" +run = "buf lint" + +[tasks."proto:format"] +description = "Format protobuf files in place" +dir = "proto" +run = "buf format -w" + +[tasks."proto:dep-update"] +description = "Refresh buf.lock from BSR dependencies (googleapis)" +dir = "proto" +run = "buf dep update" + +[tasks."proto:generate"] +description = "Generate OpenAPI from the proto contract (BSR remote plugin)" +dir = "proto" +run = "buf generate" + # All tasks moved to mise-tasks/ for better maintainability and shellcheck/shfmt support: # - dev -> mise-tasks/dev.sh # - test:e2e -> mise-tasks/test/e2e.sh diff --git a/proto/README.md b/proto/README.md new file mode 100644 index 00000000..f65ba843 --- /dev/null +++ b/proto/README.md @@ -0,0 +1,50 @@ +# API contract (proto-first) + +The online "my festival" API (ratings + recommendations) is defined here as +Protocol Buffers following [Google's API Improvement Proposals](https://google.aip.dev) +(AIP). The proto is the source of truth; an OpenAPI v3 document is generated +from it for the (hand-written) Cloudflare Worker implementation and any HTTP +clients. + +The transport is plain HTTP/JSON — the `google.api.http` annotations map each +RPC to a REST route. We do **not** run a gRPC server; the proto is the contract +and OpenAPI is the generated artifact. + +## Layout + +``` +proto/ +├── buf.yaml # module + lint/breaking config, BSR deps +├── buf.gen.yaml # codegen: OpenAPI via BSR remote plugin +└── cambeerfestival/myfestival/v1/ + ├── rating.proto # Rating + RatingSummary resources + ├── recommendation.proto # Recommendation + RecommendationSummary + └── my_festival_service.proto # service + request/response messages +``` + +## Resource model (AIP-121/122) + +| Resource | Name pattern | Methods | +| --- | --- | --- | +| `Rating` | `festivals/{f}/drinks/{d}/ratings/{device}` | Get, Update (upsert), Delete | +| `RatingSummary` | `festivals/{f}/ratingSummaries/{d}` | Get, List (paginated) | +| `Recommendation` | `festivals/{f}/drinks/{d}/recommendations/{device}` | Get, Update (upsert), Delete | +| `RecommendationSummary` | `festivals/{f}/recommendationSummaries/{d}` | Get, List (paginated) | + +Writes use **Update with `allow_missing`** (AIP-134 upsert) because the device +assigns the resource id; **Delete** takes the id in the path with no body +(AIP-135). Aggregates are read-only computed resources, listed with pagination +(AIP-158). Errors follow the structured `google.rpc.Status` shape (AIP-193). + +## Generating + +Requires the `buf` toolchain (provided by mise) and network access to +`buf.build` (BSR module deps + the remote OpenAPI plugin). + +```bash +MISE_ENV=dev ./bin/mise run proto:dep-update # writes buf.lock (first time) +MISE_ENV=dev ./bin/mise run proto:lint # AIP-aware lint +MISE_ENV=dev ./bin/mise run proto:generate # -> docs/code/api/openapi/openapi.yaml +``` + +`buf format -w` (via `proto:format`) keeps the files canonically formatted. diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml new file mode 100644 index 00000000..9f5e45f0 --- /dev/null +++ b/proto/buf.gen.yaml @@ -0,0 +1,10 @@ +version: v2 +clean: true +plugins: + # OpenAPI v3 generated from the google.api.http annotations, via a BSR + # remote plugin (no local protoc/plugin install needed). + - remote: buf.build/community/google-gnostic-openapi:v0.7.0 + out: ../docs/code/api/openapi + opt: + - enum_type=string + - default_response=false diff --git a/proto/buf.yaml b/proto/buf.yaml new file mode 100644 index 00000000..76a071bf --- /dev/null +++ b/proto/buf.yaml @@ -0,0 +1,17 @@ +version: v2 +modules: + - path: . +deps: + - buf.build/googleapis/googleapis +lint: + use: + - STANDARD + except: + # AIP-131/134: Get and Update return the resource itself, and Delete + # returns google.protobuf.Empty — both intentionally diverge from buf's + # "Response" / unique-response defaults. Google's own APIs do the same. + - RPC_RESPONSE_STANDARD_NAME + - RPC_REQUEST_RESPONSE_UNIQUE +breaking: + use: + - FILE diff --git a/proto/cambeerfestival/myfestival/v1/my_festival_service.proto b/proto/cambeerfestival/myfestival/v1/my_festival_service.proto new file mode 100644 index 00000000..e89102c7 --- /dev/null +++ b/proto/cambeerfestival/myfestival/v1/my_festival_service.proto @@ -0,0 +1,246 @@ +// Online "my festival" API: shared rating and recommendation aggregates. +syntax = "proto3"; + +package cambeerfestival.myfestival.v1; + +import "cambeerfestival/myfestival/v1/rating.proto"; +import "cambeerfestival/myfestival/v1/recommendation.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +// Stores each device's rating / "would recommend" answer for a drink and +// serves back the bucket-scoped aggregate. Writes are local-first on the +// client; this service is the shared, cross-device aggregate. +service MyFestivalService { + option (google.api.default_host) = "data.cambeerfestival.app"; + + // --- Ratings ------------------------------------------------------------- + + // Get this device's rating for a drink. + rpc GetRating(GetRatingRequest) returns (Rating) { + option (google.api.http) = { + get: "/v1/{name=festivals/*/drinks/*/ratings/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Create or update this device's rating for a drink (upsert). + rpc UpdateRating(UpdateRatingRequest) returns (Rating) { + option (google.api.http) = { + patch: "/v1/{rating.name=festivals/*/drinks/*/ratings/*}" + body: "rating" + }; + option (google.api.method_signature) = "rating,update_mask"; + } + + // Remove this device's rating for a drink. + rpc DeleteRating(DeleteRatingRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=festivals/*/drinks/*/ratings/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Get the aggregate rating for a single drink. + rpc GetRatingSummary(GetRatingSummaryRequest) returns (RatingSummary) { + option (google.api.http) = { + get: "/v1/{name=festivals/*/ratingSummaries/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List aggregate ratings for every rated drink at a festival. + rpc ListRatingSummaries(ListRatingSummariesRequest) + returns (ListRatingSummariesResponse) { + option (google.api.http) = { + get: "/v1/{parent=festivals/*}/ratingSummaries" + }; + option (google.api.method_signature) = "parent"; + } + + // --- Recommendations ----------------------------------------------------- + + // Get this device's "would recommend" answer for a drink. + rpc GetRecommendation(GetRecommendationRequest) returns (Recommendation) { + option (google.api.http) = { + get: "/v1/{name=festivals/*/drinks/*/recommendations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Create or update this device's "would recommend" answer (upsert). + rpc UpdateRecommendation(UpdateRecommendationRequest) + returns (Recommendation) { + option (google.api.http) = { + patch: "/v1/{recommendation.name=festivals/*/drinks/*/recommendations/*}" + body: "recommendation" + }; + option (google.api.method_signature) = "recommendation,update_mask"; + } + + // Remove this device's "would recommend" answer for a drink. + rpc DeleteRecommendation(DeleteRecommendationRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=festivals/*/drinks/*/recommendations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Get the aggregate recommendation for a single drink. + rpc GetRecommendationSummary(GetRecommendationSummaryRequest) + returns (RecommendationSummary) { + option (google.api.http) = { + get: "/v1/{name=festivals/*/recommendationSummaries/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List aggregate recommendations for every drink with an answer. + rpc ListRecommendationSummaries(ListRecommendationSummariesRequest) + returns (ListRecommendationSummariesResponse) { + option (google.api.http) = { + get: "/v1/{parent=festivals/*}/recommendationSummaries" + }; + option (google.api.method_signature) = "parent"; + } +} + +// --- Rating requests ------------------------------------------------------- + +message GetRatingRequest { + // Resource name: festivals/{festival}/drinks/{drink}/ratings/{device}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = + "myfestival.cambeerfestival.app/Rating" + ]; +} + +message UpdateRatingRequest { + // The rating to set. Its `name` identifies the resource. + Rating rating = 1 [(google.api.field_behavior) = REQUIRED]; + + // Fields to update; omit to update all populated fields. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // If true (the default for this API), create the rating when absent (upsert). + bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +message DeleteRatingRequest { + // Resource name: festivals/{festival}/drinks/{drink}/ratings/{device}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = + "myfestival.cambeerfestival.app/Rating" + ]; +} + +message GetRatingSummaryRequest { + // Resource name: festivals/{festival}/ratingSummaries/{drink}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = + "myfestival.cambeerfestival.app/RatingSummary" + ]; +} + +message ListRatingSummariesRequest { + // Parent festival: festivals/{festival}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).child_type = + "myfestival.cambeerfestival.app/RatingSummary" + ]; + + // Maximum number to return; the server may return fewer. Defaults applied + // when unset or zero. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Page token from a previous response. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +message ListRatingSummariesResponse { + // Aggregate ratings for this page, one per rated drink. + repeated RatingSummary rating_summaries = 1; + + // Token for the next page; empty when there are no more. + string next_page_token = 2; + + // Total number of rated drinks at the festival. + int32 total_size = 3; +} + +// --- Recommendation requests ----------------------------------------------- + +message GetRecommendationRequest { + // festivals/{festival}/drinks/{drink}/recommendations/{device}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = + "myfestival.cambeerfestival.app/Recommendation" + ]; +} + +message UpdateRecommendationRequest { + // The answer to set. Its `name` identifies the resource. + Recommendation recommendation = 1 [(google.api.field_behavior) = REQUIRED]; + + // Fields to update; omit to update all populated fields. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // If true (the default for this API), create the answer when absent (upsert). + bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +message DeleteRecommendationRequest { + // festivals/{festival}/drinks/{drink}/recommendations/{device}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = + "myfestival.cambeerfestival.app/Recommendation" + ]; +} + +message GetRecommendationSummaryRequest { + // festivals/{festival}/recommendationSummaries/{drink}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = + "myfestival.cambeerfestival.app/RecommendationSummary" + ]; +} + +message ListRecommendationSummariesRequest { + // Parent festival: festivals/{festival}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).child_type = + "myfestival.cambeerfestival.app/RecommendationSummary" + ]; + + // Maximum number to return; the server may return fewer. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Page token from a previous response. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +message ListRecommendationSummariesResponse { + // Aggregate recommendations for this page, one per drink with an answer. + repeated RecommendationSummary recommendation_summaries = 1; + + // Token for the next page; empty when there are no more. + string next_page_token = 2; + + // Total number of drinks with at least one answer. + int32 total_size = 3; +} diff --git a/proto/cambeerfestival/myfestival/v1/rating.proto b/proto/cambeerfestival/myfestival/v1/rating.proto new file mode 100644 index 00000000..c37160ba --- /dev/null +++ b/proto/cambeerfestival/myfestival/v1/rating.proto @@ -0,0 +1,53 @@ +// Aggregate drink ratings for the online "my festival" API. +syntax = "proto3"; + +package cambeerfestival.myfestival.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +// A single device's star rating for one drink at one festival. +// +// The resource id is the device (anonymous now, a signed-in user later), so a +// device has at most one rating per drink — updating it overwrites in place. +message Rating { + option (google.api.resource) = { + type: "myfestival.cambeerfestival.app/Rating" + pattern: "festivals/{festival}/drinks/{drink}/ratings/{device}" + singular: "rating" + plural: "ratings" + }; + + // Resource name: festivals/{festival}/drinks/{drink}/ratings/{device}. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The star rating, 1-5 inclusive. + int32 value = 2 [(google.api.field_behavior) = REQUIRED]; + + // When the rating was last set. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Computed, read-only aggregate of every device's rating for one drink. +// +// Keyed by drink under the festival so the whole festival can be listed in one +// paginated call for list/grid views. +message RatingSummary { + option (google.api.resource) = { + type: "myfestival.cambeerfestival.app/RatingSummary" + pattern: "festivals/{festival}/ratingSummaries/{drink}" + singular: "ratingSummary" + plural: "ratingSummaries" + }; + + // Resource name: festivals/{festival}/ratingSummaries/{drink}. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Number of ratings contributing to the average. + int32 rating_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Mean rating across all devices (1.0-5.0); 0 when there are no ratings. + double average_rating = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/proto/cambeerfestival/myfestival/v1/recommendation.proto b/proto/cambeerfestival/myfestival/v1/recommendation.proto new file mode 100644 index 00000000..fee006c5 --- /dev/null +++ b/proto/cambeerfestival/myfestival/v1/recommendation.proto @@ -0,0 +1,53 @@ +// "Would recommend" signal for the online "my festival" API. +syntax = "proto3"; + +package cambeerfestival.myfestival.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +// A single device's "would recommend" answer for one drink at one festival. +// +// Separate from the star rating so a drink can surface a "% would recommend". +// The device is the resource id, so a device has at most one answer per drink. +message Recommendation { + option (google.api.resource) = { + type: "myfestival.cambeerfestival.app/Recommendation" + pattern: "festivals/{festival}/drinks/{drink}/recommendations/{device}" + singular: "recommendation" + plural: "recommendations" + }; + + // Resource name: festivals/{festival}/drinks/{drink}/recommendations/{device}. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Whether this device would recommend the drink. + bool would_recommend = 2 [(google.api.field_behavior) = REQUIRED]; + + // When the answer was last set. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Computed, read-only aggregate of every device's answer for one drink. +message RecommendationSummary { + option (google.api.resource) = { + type: "myfestival.cambeerfestival.app/RecommendationSummary" + pattern: "festivals/{festival}/recommendationSummaries/{drink}" + singular: "recommendationSummary" + plural: "recommendationSummaries" + }; + + // Resource name: festivals/{festival}/recommendationSummaries/{drink}. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Total number of yes/no responses. + int32 response_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Number of responses that would recommend. + int32 recommend_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Fraction (0.0-1.0) of responses that would recommend; 0 when none. + double recommend_rate = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} From 7111c4400b9c11a211a5112929309fcf73b8f37d Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 12 Jun 2026 20:43:37 +0000 Subject: [PATCH 02/13] fix(proto): add buf.lock and apply buf format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Run buf dep update to pin googleapis BSR dependency (buf.lock was missing from the branch), then buf format -w to normalise whitespace — collapsing multi-line option/field blocks onto single lines per buf's default style. buf lint now passes cleanly. https://claude.ai/code/session_01WX7GbU19M9fh3tAfAxzeET --- proto/buf.lock | 6 ++ .../myfestival/v1/my_festival_service.proto | 77 ++++++------------- .../myfestival/v1/rating.proto | 3 +- .../myfestival/v1/recommendation.proto | 3 +- 4 files changed, 31 insertions(+), 58 deletions(-) create mode 100644 proto/buf.lock diff --git a/proto/buf.lock b/proto/buf.lock new file mode 100644 index 00000000..84475891 --- /dev/null +++ b/proto/buf.lock @@ -0,0 +1,6 @@ +# Generated by buf. DO NOT EDIT. +version: v2 +deps: + - name: buf.build/googleapis/googleapis + commit: c17df5b2beca46928cc87d5656bd5343 + digest: b5:648a01e0170d4512dea7d564016165decd1ed6e34bef79fe54753e51ad7e27545709ad9157d7551270147d551155c595a2fb0bf5bb33b1c83040ddbce915c604 diff --git a/proto/cambeerfestival/myfestival/v1/my_festival_service.proto b/proto/cambeerfestival/myfestival/v1/my_festival_service.proto index e89102c7..e304b70c 100644 --- a/proto/cambeerfestival/myfestival/v1/my_festival_service.proto +++ b/proto/cambeerfestival/myfestival/v1/my_festival_service.proto @@ -22,9 +22,7 @@ service MyFestivalService { // Get this device's rating for a drink. rpc GetRating(GetRatingRequest) returns (Rating) { - option (google.api.http) = { - get: "/v1/{name=festivals/*/drinks/*/ratings/*}" - }; + option (google.api.http) = {get: "/v1/{name=festivals/*/drinks/*/ratings/*}"}; option (google.api.method_signature) = "name"; } @@ -39,26 +37,19 @@ service MyFestivalService { // Remove this device's rating for a drink. rpc DeleteRating(DeleteRatingRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=festivals/*/drinks/*/ratings/*}" - }; + option (google.api.http) = {delete: "/v1/{name=festivals/*/drinks/*/ratings/*}"}; option (google.api.method_signature) = "name"; } // Get the aggregate rating for a single drink. rpc GetRatingSummary(GetRatingSummaryRequest) returns (RatingSummary) { - option (google.api.http) = { - get: "/v1/{name=festivals/*/ratingSummaries/*}" - }; + option (google.api.http) = {get: "/v1/{name=festivals/*/ratingSummaries/*}"}; option (google.api.method_signature) = "name"; } // List aggregate ratings for every rated drink at a festival. - rpc ListRatingSummaries(ListRatingSummariesRequest) - returns (ListRatingSummariesResponse) { - option (google.api.http) = { - get: "/v1/{parent=festivals/*}/ratingSummaries" - }; + rpc ListRatingSummaries(ListRatingSummariesRequest) returns (ListRatingSummariesResponse) { + option (google.api.http) = {get: "/v1/{parent=festivals/*}/ratingSummaries"}; option (google.api.method_signature) = "parent"; } @@ -66,15 +57,12 @@ service MyFestivalService { // Get this device's "would recommend" answer for a drink. rpc GetRecommendation(GetRecommendationRequest) returns (Recommendation) { - option (google.api.http) = { - get: "/v1/{name=festivals/*/drinks/*/recommendations/*}" - }; + option (google.api.http) = {get: "/v1/{name=festivals/*/drinks/*/recommendations/*}"}; option (google.api.method_signature) = "name"; } // Create or update this device's "would recommend" answer (upsert). - rpc UpdateRecommendation(UpdateRecommendationRequest) - returns (Recommendation) { + rpc UpdateRecommendation(UpdateRecommendationRequest) returns (Recommendation) { option (google.api.http) = { patch: "/v1/{recommendation.name=festivals/*/drinks/*/recommendations/*}" body: "recommendation" @@ -83,29 +71,20 @@ service MyFestivalService { } // Remove this device's "would recommend" answer for a drink. - rpc DeleteRecommendation(DeleteRecommendationRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=festivals/*/drinks/*/recommendations/*}" - }; + rpc DeleteRecommendation(DeleteRecommendationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = {delete: "/v1/{name=festivals/*/drinks/*/recommendations/*}"}; option (google.api.method_signature) = "name"; } // Get the aggregate recommendation for a single drink. - rpc GetRecommendationSummary(GetRecommendationSummaryRequest) - returns (RecommendationSummary) { - option (google.api.http) = { - get: "/v1/{name=festivals/*/recommendationSummaries/*}" - }; + rpc GetRecommendationSummary(GetRecommendationSummaryRequest) returns (RecommendationSummary) { + option (google.api.http) = {get: "/v1/{name=festivals/*/recommendationSummaries/*}"}; option (google.api.method_signature) = "name"; } // List aggregate recommendations for every drink with an answer. - rpc ListRecommendationSummaries(ListRecommendationSummariesRequest) - returns (ListRecommendationSummariesResponse) { - option (google.api.http) = { - get: "/v1/{parent=festivals/*}/recommendationSummaries" - }; + rpc ListRecommendationSummaries(ListRecommendationSummariesRequest) returns (ListRecommendationSummariesResponse) { + option (google.api.http) = {get: "/v1/{parent=festivals/*}/recommendationSummaries"}; option (google.api.method_signature) = "parent"; } } @@ -116,8 +95,7 @@ message GetRatingRequest { // Resource name: festivals/{festival}/drinks/{drink}/ratings/{device}. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = - "myfestival.cambeerfestival.app/Rating" + (google.api.resource_reference).type = "myfestival.cambeerfestival.app/Rating" ]; } @@ -126,8 +104,7 @@ message UpdateRatingRequest { Rating rating = 1 [(google.api.field_behavior) = REQUIRED]; // Fields to update; omit to update all populated fields. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; // If true (the default for this API), create the rating when absent (upsert). bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; @@ -137,8 +114,7 @@ message DeleteRatingRequest { // Resource name: festivals/{festival}/drinks/{drink}/ratings/{device}. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = - "myfestival.cambeerfestival.app/Rating" + (google.api.resource_reference).type = "myfestival.cambeerfestival.app/Rating" ]; } @@ -146,8 +122,7 @@ message GetRatingSummaryRequest { // Resource name: festivals/{festival}/ratingSummaries/{drink}. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = - "myfestival.cambeerfestival.app/RatingSummary" + (google.api.resource_reference).type = "myfestival.cambeerfestival.app/RatingSummary" ]; } @@ -155,8 +130,7 @@ message ListRatingSummariesRequest { // Parent festival: festivals/{festival}. string parent = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).child_type = - "myfestival.cambeerfestival.app/RatingSummary" + (google.api.resource_reference).child_type = "myfestival.cambeerfestival.app/RatingSummary" ]; // Maximum number to return; the server may return fewer. Defaults applied @@ -184,8 +158,7 @@ message GetRecommendationRequest { // festivals/{festival}/drinks/{drink}/recommendations/{device}. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = - "myfestival.cambeerfestival.app/Recommendation" + (google.api.resource_reference).type = "myfestival.cambeerfestival.app/Recommendation" ]; } @@ -194,8 +167,7 @@ message UpdateRecommendationRequest { Recommendation recommendation = 1 [(google.api.field_behavior) = REQUIRED]; // Fields to update; omit to update all populated fields. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; // If true (the default for this API), create the answer when absent (upsert). bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; @@ -205,8 +177,7 @@ message DeleteRecommendationRequest { // festivals/{festival}/drinks/{drink}/recommendations/{device}. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = - "myfestival.cambeerfestival.app/Recommendation" + (google.api.resource_reference).type = "myfestival.cambeerfestival.app/Recommendation" ]; } @@ -214,8 +185,7 @@ message GetRecommendationSummaryRequest { // festivals/{festival}/recommendationSummaries/{drink}. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = - "myfestival.cambeerfestival.app/RecommendationSummary" + (google.api.resource_reference).type = "myfestival.cambeerfestival.app/RecommendationSummary" ]; } @@ -223,8 +193,7 @@ message ListRecommendationSummariesRequest { // Parent festival: festivals/{festival}. string parent = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).child_type = - "myfestival.cambeerfestival.app/RecommendationSummary" + (google.api.resource_reference).child_type = "myfestival.cambeerfestival.app/RecommendationSummary" ]; // Maximum number to return; the server may return fewer. diff --git a/proto/cambeerfestival/myfestival/v1/rating.proto b/proto/cambeerfestival/myfestival/v1/rating.proto index c37160ba..0126db79 100644 --- a/proto/cambeerfestival/myfestival/v1/rating.proto +++ b/proto/cambeerfestival/myfestival/v1/rating.proto @@ -26,8 +26,7 @@ message Rating { int32 value = 2 [(google.api.field_behavior) = REQUIRED]; // When the rating was last set. - google.protobuf.Timestamp update_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Computed, read-only aggregate of every device's rating for one drink. diff --git a/proto/cambeerfestival/myfestival/v1/recommendation.proto b/proto/cambeerfestival/myfestival/v1/recommendation.proto index fee006c5..ac641ebc 100644 --- a/proto/cambeerfestival/myfestival/v1/recommendation.proto +++ b/proto/cambeerfestival/myfestival/v1/recommendation.proto @@ -26,8 +26,7 @@ message Recommendation { bool would_recommend = 2 [(google.api.field_behavior) = REQUIRED]; // When the answer was last set. - google.protobuf.Timestamp update_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Computed, read-only aggregate of every device's answer for one drink. From b9763a0a87e20c0f7087559ceddb3fd0a8c2d947 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 12 Jun 2026 20:58:36 +0000 Subject: [PATCH 03/13] refactor(proto): model Rating and Recommendation as singleton resources MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The caller is always implicit — device/user identity comes from the auth context, not the URL. Replacing the ratings/{device} collection with a singleton per (caller, drink) means: - Device IDs never leak into resource names or logs - URLs are unchanged when device tokens are replaced by user tokens - Clients never need to know their own identity to construct a name Pattern changes: festivals/{f}/drinks/{d}/ratings/{device} → festivals/{f}/drinks/{d}/rating festivals/{f}/drinks/{d}/recommendations/{device} → festivals/{f}/drinks/{d}/recommendation Also: drop plural from singleton resource annotations; add DECLARATIVE_FRIENDLY style; clarify allow_missing is always-true for singletons (retained for AIP-134 generator compat); update all comments from "device" to "caller". buf lint passes. https://claude.ai/code/session_01WX7GbU19M9fh3tAfAxzeET --- .../myfestival/v1/my_festival_service.proto | 51 +++++++++++-------- .../myfestival/v1/rating.proto | 18 ++++--- .../myfestival/v1/recommendation.proto | 17 ++++--- 3 files changed, 48 insertions(+), 38 deletions(-) diff --git a/proto/cambeerfestival/myfestival/v1/my_festival_service.proto b/proto/cambeerfestival/myfestival/v1/my_festival_service.proto index e304b70c..87714961 100644 --- a/proto/cambeerfestival/myfestival/v1/my_festival_service.proto +++ b/proto/cambeerfestival/myfestival/v1/my_festival_service.proto @@ -12,32 +12,37 @@ import "google/api/resource.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; -// Stores each device's rating / "would recommend" answer for a drink and -// serves back the bucket-scoped aggregate. Writes are local-first on the -// client; this service is the shared, cross-device aggregate. +// Stores the caller's rating / "would recommend" answer for a drink and serves +// back the bucket-scoped aggregate. Writes are local-first on the client; this +// service holds the shared, cross-device aggregate. +// +// Rating and Recommendation are singleton resources — one per (caller, drink). +// The caller's identity is resolved from the auth context; it never appears in +// the resource name, keeping device IDs private and making the sign-in upgrade +// transparent to existing clients. service MyFestivalService { option (google.api.default_host) = "data.cambeerfestival.app"; // --- Ratings ------------------------------------------------------------- - // Get this device's rating for a drink. + // Get the caller's rating for a drink. rpc GetRating(GetRatingRequest) returns (Rating) { - option (google.api.http) = {get: "/v1/{name=festivals/*/drinks/*/ratings/*}"}; + option (google.api.http) = {get: "/v1/{name=festivals/*/drinks/*/rating}"}; option (google.api.method_signature) = "name"; } - // Create or update this device's rating for a drink (upsert). + // Create or update the caller's rating for a drink (upsert). rpc UpdateRating(UpdateRatingRequest) returns (Rating) { option (google.api.http) = { - patch: "/v1/{rating.name=festivals/*/drinks/*/ratings/*}" + patch: "/v1/{rating.name=festivals/*/drinks/*/rating}" body: "rating" }; option (google.api.method_signature) = "rating,update_mask"; } - // Remove this device's rating for a drink. + // Remove the caller's rating for a drink. rpc DeleteRating(DeleteRatingRequest) returns (google.protobuf.Empty) { - option (google.api.http) = {delete: "/v1/{name=festivals/*/drinks/*/ratings/*}"}; + option (google.api.http) = {delete: "/v1/{name=festivals/*/drinks/*/rating}"}; option (google.api.method_signature) = "name"; } @@ -55,24 +60,24 @@ service MyFestivalService { // --- Recommendations ----------------------------------------------------- - // Get this device's "would recommend" answer for a drink. + // Get the caller's "would recommend" answer for a drink. rpc GetRecommendation(GetRecommendationRequest) returns (Recommendation) { - option (google.api.http) = {get: "/v1/{name=festivals/*/drinks/*/recommendations/*}"}; + option (google.api.http) = {get: "/v1/{name=festivals/*/drinks/*/recommendation}"}; option (google.api.method_signature) = "name"; } - // Create or update this device's "would recommend" answer (upsert). + // Create or update the caller's "would recommend" answer (upsert). rpc UpdateRecommendation(UpdateRecommendationRequest) returns (Recommendation) { option (google.api.http) = { - patch: "/v1/{recommendation.name=festivals/*/drinks/*/recommendations/*}" + patch: "/v1/{recommendation.name=festivals/*/drinks/*/recommendation}" body: "recommendation" }; option (google.api.method_signature) = "recommendation,update_mask"; } - // Remove this device's "would recommend" answer for a drink. + // Remove the caller's "would recommend" answer for a drink. rpc DeleteRecommendation(DeleteRecommendationRequest) returns (google.protobuf.Empty) { - option (google.api.http) = {delete: "/v1/{name=festivals/*/drinks/*/recommendations/*}"}; + option (google.api.http) = {delete: "/v1/{name=festivals/*/drinks/*/recommendation}"}; option (google.api.method_signature) = "name"; } @@ -92,7 +97,7 @@ service MyFestivalService { // --- Rating requests ------------------------------------------------------- message GetRatingRequest { - // Resource name: festivals/{festival}/drinks/{drink}/ratings/{device}. + // Resource name: festivals/{festival}/drinks/{drink}/rating. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference).type = "myfestival.cambeerfestival.app/Rating" @@ -106,12 +111,13 @@ message UpdateRatingRequest { // Fields to update; omit to update all populated fields. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; - // If true (the default for this API), create the rating when absent (upsert). + // Always an upsert for this singleton — the field is retained for + // AIP-134 generator compatibility but the server treats it as always true. bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; } message DeleteRatingRequest { - // Resource name: festivals/{festival}/drinks/{drink}/ratings/{device}. + // Resource name: festivals/{festival}/drinks/{drink}/rating. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference).type = "myfestival.cambeerfestival.app/Rating" @@ -155,7 +161,7 @@ message ListRatingSummariesResponse { // --- Recommendation requests ----------------------------------------------- message GetRecommendationRequest { - // festivals/{festival}/drinks/{drink}/recommendations/{device}. + // Resource name: festivals/{festival}/drinks/{drink}/recommendation. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference).type = "myfestival.cambeerfestival.app/Recommendation" @@ -169,12 +175,13 @@ message UpdateRecommendationRequest { // Fields to update; omit to update all populated fields. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; - // If true (the default for this API), create the answer when absent (upsert). + // Always an upsert for this singleton — retained for AIP-134 generator + // compatibility but the server treats it as always true. bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; } message DeleteRecommendationRequest { - // festivals/{festival}/drinks/{drink}/recommendations/{device}. + // Resource name: festivals/{festival}/drinks/{drink}/recommendation. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference).type = "myfestival.cambeerfestival.app/Recommendation" @@ -182,7 +189,7 @@ message DeleteRecommendationRequest { } message GetRecommendationSummaryRequest { - // festivals/{festival}/recommendationSummaries/{drink}. + // Resource name: festivals/{festival}/recommendationSummaries/{drink}. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference).type = "myfestival.cambeerfestival.app/RecommendationSummary" diff --git a/proto/cambeerfestival/myfestival/v1/rating.proto b/proto/cambeerfestival/myfestival/v1/rating.proto index 0126db79..7f6ace6f 100644 --- a/proto/cambeerfestival/myfestival/v1/rating.proto +++ b/proto/cambeerfestival/myfestival/v1/rating.proto @@ -7,19 +7,21 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; -// A single device's star rating for one drink at one festival. +// The caller's star rating for one drink at one festival. // -// The resource id is the device (anonymous now, a signed-in user later), so a -// device has at most one rating per drink — updating it overwrites in place. +// Singleton resource — there is exactly one rating per (caller, drink). The +// caller is implicit in the auth context; their identity never appears in the +// resource name, so device IDs stay private and the same URLs work unchanged +// when anonymous device tokens are replaced by signed-in user tokens. message Rating { option (google.api.resource) = { type: "myfestival.cambeerfestival.app/Rating" - pattern: "festivals/{festival}/drinks/{drink}/ratings/{device}" + pattern: "festivals/{festival}/drinks/{drink}/rating" singular: "rating" - plural: "ratings" + style: DECLARATIVE_FRIENDLY }; - // Resource name: festivals/{festival}/drinks/{drink}/ratings/{device}. + // Resource name: festivals/{festival}/drinks/{drink}/rating. string name = 1 [(google.api.field_behavior) = IDENTIFIER]; // The star rating, 1-5 inclusive. @@ -29,7 +31,7 @@ message Rating { google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } -// Computed, read-only aggregate of every device's rating for one drink. +// Computed, read-only aggregate of every caller's rating for one drink. // // Keyed by drink under the festival so the whole festival can be listed in one // paginated call for list/grid views. @@ -47,6 +49,6 @@ message RatingSummary { // Number of ratings contributing to the average. int32 rating_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Mean rating across all devices (1.0-5.0); 0 when there are no ratings. + // Mean rating across all callers (1.0-5.0); 0 when there are no ratings. double average_rating = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/proto/cambeerfestival/myfestival/v1/recommendation.proto b/proto/cambeerfestival/myfestival/v1/recommendation.proto index ac641ebc..a1dc46df 100644 --- a/proto/cambeerfestival/myfestival/v1/recommendation.proto +++ b/proto/cambeerfestival/myfestival/v1/recommendation.proto @@ -7,29 +7,30 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; -// A single device's "would recommend" answer for one drink at one festival. +// The caller's "would recommend" answer for one drink at one festival. // -// Separate from the star rating so a drink can surface a "% would recommend". -// The device is the resource id, so a device has at most one answer per drink. +// Singleton resource — there is exactly one answer per (caller, drink). +// Caller identity is implicit in the auth context; device IDs never appear +// in the URL, and the same paths work unchanged after the sign-in upgrade. message Recommendation { option (google.api.resource) = { type: "myfestival.cambeerfestival.app/Recommendation" - pattern: "festivals/{festival}/drinks/{drink}/recommendations/{device}" + pattern: "festivals/{festival}/drinks/{drink}/recommendation" singular: "recommendation" - plural: "recommendations" + style: DECLARATIVE_FRIENDLY }; - // Resource name: festivals/{festival}/drinks/{drink}/recommendations/{device}. + // Resource name: festivals/{festival}/drinks/{drink}/recommendation. string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - // Whether this device would recommend the drink. + // Whether this caller would recommend the drink. bool would_recommend = 2 [(google.api.field_behavior) = REQUIRED]; // When the answer was last set. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } -// Computed, read-only aggregate of every device's answer for one drink. +// Computed, read-only aggregate of every caller's answer for one drink. message RecommendationSummary { option (google.api.resource) = { type: "myfestival.cambeerfestival.app/RecommendationSummary" From ff17e2303820547f43bb93f6811a7ce39ba42ebe Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 13 Jun 2026 07:28:36 +0000 Subject: [PATCH 04/13] feat(proto): add api-linter (AIP design linter) to dev toolchain Install googleapis/api-linter via mise (github backend, dev-only while the API design is in flux; move to base once shapes and signatures stabilise). Add proto:api-lint task: builds a buf descriptor set then runs api-linter with --descriptor-set-in so imported googleapis protos resolve without a separate proto-path. Add proto/.api-linter.yaml config that suppresses three intentional divergences from the default ruleset: - 0191 java-*: not a Java API - 0156 forbidden-methods: singletons expose Delete because ratings are absent-until-rated, not always-present - 0123 resource-pattern-singular: summary patterns use {drink} not {rating_summary} for readable URLs Fix proto issues surfaced by the first run: - Remove style: DECLARATIVE_FRIENDLY (triggered etag/LRO/reconciling requirements we don't want; the singleton pattern stands alone) - Restore plural on Rating/Recommendation (required metadata even for singletons per AIP-0123) - Add doc comments to all request/response messages (AIP-0192) - Remove blank lines between section-separator comments and first RPCs (AIP-0192 only-leading-comments) buf lint and api-linter both pass clean. https://claude.ai/code/session_01WX7GbU19M9fh3tAfAxzeET --- mise.dev.toml | 20 ++++++++++++++++++- proto/.api-linter.yaml | 19 ++++++++++++++++++ .../myfestival/v1/my_festival_service.proto | 18 +++++++++++------ .../myfestival/v1/rating.proto | 2 +- .../myfestival/v1/recommendation.proto | 2 +- 5 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 proto/.api-linter.yaml diff --git a/mise.dev.toml b/mise.dev.toml index 7f8101e5..45a7c5ec 100644 --- a/mise.dev.toml +++ b/mise.dev.toml @@ -20,9 +20,14 @@ watchexec = "2.5.1" # --- Protobuf / OpenAPI (API contract is proto-first; see proto/README.md) --- # buf is provided by the base mise.toml tools. The proto tasks require network # access to buf.build (BSR deps + remote OpenAPI plugin). +# +# api-linter lives here (dev-only) while the API design is still in flux. +# Move it to base mise.toml once the resource shapes and method signatures +# have stabilised and the linter output is expected to stay clean in CI. +"github:googleapis/api-linter" = "latest" [tasks."proto:lint"] -description = "Lint the protobuf API contract" +description = "Lint the protobuf API contract (buf STANDARD ruleset)" dir = "proto" run = "buf lint" @@ -41,6 +46,19 @@ description = "Generate OpenAPI from the proto contract (BSR remote plugin)" dir = "proto" run = "buf generate" +[tasks."proto:api-lint"] +description = "Lint proto files against Google AIP design guidelines (googleapis/api-linter)" +dir = "proto" +run = """ +buf build -o /tmp/cambeerfestival.pb +api-linter \ + --config .api-linter.yaml \ + --descriptor-set-in=/tmp/cambeerfestival.pb \ + cambeerfestival/myfestival/v1/my_festival_service.proto \ + cambeerfestival/myfestival/v1/rating.proto \ + cambeerfestival/myfestival/v1/recommendation.proto +""" + # All tasks moved to mise-tasks/ for better maintainability and shellcheck/shfmt support: # - dev -> mise-tasks/dev.sh # - test:e2e -> mise-tasks/test/e2e.sh diff --git a/proto/.api-linter.yaml b/proto/.api-linter.yaml new file mode 100644 index 00000000..9fbd6965 --- /dev/null +++ b/proto/.api-linter.yaml @@ -0,0 +1,19 @@ +# api-linter (https://linter.aip.dev) configuration. +# +# Suppressed rules — each suppression is intentional: +# +# 0191 java-*: Not building Java clients; Java file options are irrelevant. +# +# 0156 forbidden-methods: Rating and Recommendation singletons expose Delete +# because a rating is absent until the caller rates something — these +# are not "always-present" singletons. See AIP-156 §absent-singletons. +# +# 0123 resource-pattern-singular: RatingSummary/RecommendationSummary use +# {drink} as the final URL segment (not {rating_summary}) so that the +# path reads as a natural key: .../ratingSummaries/{drinkId}. +- disabled_rules: + - core::0191::java-package + - core::0191::java-multiple-files + - core::0191::java-outer-classname + - core::0156::forbidden-methods + - core::0123::resource-pattern-singular diff --git a/proto/cambeerfestival/myfestival/v1/my_festival_service.proto b/proto/cambeerfestival/myfestival/v1/my_festival_service.proto index 87714961..4b6dfc4b 100644 --- a/proto/cambeerfestival/myfestival/v1/my_festival_service.proto +++ b/proto/cambeerfestival/myfestival/v1/my_festival_service.proto @@ -24,7 +24,6 @@ service MyFestivalService { option (google.api.default_host) = "data.cambeerfestival.app"; // --- Ratings ------------------------------------------------------------- - // Get the caller's rating for a drink. rpc GetRating(GetRatingRequest) returns (Rating) { option (google.api.http) = {get: "/v1/{name=festivals/*/drinks/*/rating}"}; @@ -59,7 +58,6 @@ service MyFestivalService { } // --- Recommendations ----------------------------------------------------- - // Get the caller's "would recommend" answer for a drink. rpc GetRecommendation(GetRecommendationRequest) returns (Recommendation) { option (google.api.http) = {get: "/v1/{name=festivals/*/drinks/*/recommendation}"}; @@ -94,8 +92,7 @@ service MyFestivalService { } } -// --- Rating requests ------------------------------------------------------- - +// Request message for GetRating. message GetRatingRequest { // Resource name: festivals/{festival}/drinks/{drink}/rating. string name = 1 [ @@ -104,6 +101,7 @@ message GetRatingRequest { ]; } +// Request message for UpdateRating. message UpdateRatingRequest { // The rating to set. Its `name` identifies the resource. Rating rating = 1 [(google.api.field_behavior) = REQUIRED]; @@ -116,6 +114,7 @@ message UpdateRatingRequest { bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; } +// Request message for DeleteRating. message DeleteRatingRequest { // Resource name: festivals/{festival}/drinks/{drink}/rating. string name = 1 [ @@ -124,6 +123,7 @@ message DeleteRatingRequest { ]; } +// Request message for GetRatingSummary. message GetRatingSummaryRequest { // Resource name: festivals/{festival}/ratingSummaries/{drink}. string name = 1 [ @@ -132,6 +132,7 @@ message GetRatingSummaryRequest { ]; } +// Request message for ListRatingSummaries. message ListRatingSummariesRequest { // Parent festival: festivals/{festival}. string parent = 1 [ @@ -147,6 +148,7 @@ message ListRatingSummariesRequest { string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; } +// Response message for ListRatingSummaries. message ListRatingSummariesResponse { // Aggregate ratings for this page, one per rated drink. repeated RatingSummary rating_summaries = 1; @@ -158,8 +160,7 @@ message ListRatingSummariesResponse { int32 total_size = 3; } -// --- Recommendation requests ----------------------------------------------- - +// Request message for GetRecommendation. message GetRecommendationRequest { // Resource name: festivals/{festival}/drinks/{drink}/recommendation. string name = 1 [ @@ -168,6 +169,7 @@ message GetRecommendationRequest { ]; } +// Request message for UpdateRecommendation. message UpdateRecommendationRequest { // The answer to set. Its `name` identifies the resource. Recommendation recommendation = 1 [(google.api.field_behavior) = REQUIRED]; @@ -180,6 +182,7 @@ message UpdateRecommendationRequest { bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; } +// Request message for DeleteRecommendation. message DeleteRecommendationRequest { // Resource name: festivals/{festival}/drinks/{drink}/recommendation. string name = 1 [ @@ -188,6 +191,7 @@ message DeleteRecommendationRequest { ]; } +// Request message for GetRecommendationSummary. message GetRecommendationSummaryRequest { // Resource name: festivals/{festival}/recommendationSummaries/{drink}. string name = 1 [ @@ -196,6 +200,7 @@ message GetRecommendationSummaryRequest { ]; } +// Request message for ListRecommendationSummaries. message ListRecommendationSummariesRequest { // Parent festival: festivals/{festival}. string parent = 1 [ @@ -210,6 +215,7 @@ message ListRecommendationSummariesRequest { string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; } +// Response message for ListRecommendationSummaries. message ListRecommendationSummariesResponse { // Aggregate recommendations for this page, one per drink with an answer. repeated RecommendationSummary recommendation_summaries = 1; diff --git a/proto/cambeerfestival/myfestival/v1/rating.proto b/proto/cambeerfestival/myfestival/v1/rating.proto index 7f6ace6f..e1af88d2 100644 --- a/proto/cambeerfestival/myfestival/v1/rating.proto +++ b/proto/cambeerfestival/myfestival/v1/rating.proto @@ -18,7 +18,7 @@ message Rating { type: "myfestival.cambeerfestival.app/Rating" pattern: "festivals/{festival}/drinks/{drink}/rating" singular: "rating" - style: DECLARATIVE_FRIENDLY + plural: "ratings" }; // Resource name: festivals/{festival}/drinks/{drink}/rating. diff --git a/proto/cambeerfestival/myfestival/v1/recommendation.proto b/proto/cambeerfestival/myfestival/v1/recommendation.proto index a1dc46df..7995e9b9 100644 --- a/proto/cambeerfestival/myfestival/v1/recommendation.proto +++ b/proto/cambeerfestival/myfestival/v1/recommendation.proto @@ -17,7 +17,7 @@ message Recommendation { type: "myfestival.cambeerfestival.app/Recommendation" pattern: "festivals/{festival}/drinks/{drink}/recommendation" singular: "recommendation" - style: DECLARATIVE_FRIENDLY + plural: "recommendations" }; // Resource name: festivals/{festival}/drinks/{drink}/recommendation. From 1d89d613051592778d92f383f9e3f2e7d5cad670 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 13 Jun 2026 07:29:20 +0000 Subject: [PATCH 05/13] chore: lock api-linter 2.3.1 in mise.dev.lock; refresh mise.lock mise lock regenerated after adding github:googleapis/api-linter to the dev env. Stale ubi:googleapis/api-linter entry pruned automatically. mise.lock refreshed with current node patch version. https://claude.ai/code/session_01WX7GbU19M9fh3tAfAxzeET --- mise.dev.lock | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/mise.dev.lock b/mise.dev.lock index 653475ba..3b4ea72a 100644 --- a/mise.dev.lock +++ b/mise.dev.lock @@ -1,5 +1,39 @@ # @generated - this file is auto-generated by `mise lock` https://mise.en.dev/dev-tools/mise-lock.html +[[tools."github:googleapis/api-linter"]] +version = "2.3.1" +backend = "github:googleapis/api-linter" + +[tools."github:googleapis/api-linter"."platforms.linux-x64"] +checksum = "sha256:c81a07f4d37a61081071f9a8b33553d4db2f9bb058a77db760d1aaf525bbf0eb" +url = "https://github.com/googleapis/api-linter/releases/download/v2.3.1/api-linter-2.3.1-linux-amd64.tar.gz" +url_api = "https://api.github.com/repos/googleapis/api-linter/releases/assets/375893821" +github_attestations = "unavailable" + +[tools."github:googleapis/api-linter"."platforms.linux-x64-musl"] +checksum = "sha256:c81a07f4d37a61081071f9a8b33553d4db2f9bb058a77db760d1aaf525bbf0eb" +url = "https://github.com/googleapis/api-linter/releases/download/v2.3.1/api-linter-2.3.1-linux-amd64.tar.gz" +url_api = "https://api.github.com/repos/googleapis/api-linter/releases/assets/375893821" +github_attestations = "unavailable" + +[tools."github:googleapis/api-linter"."platforms.macos-arm64"] +checksum = "sha256:09b7a81c3cc8c07e0b6d22a5975c245571a42eb6345787722ea992147ae20c59" +url = "https://github.com/googleapis/api-linter/releases/download/v2.3.1/api-linter-2.3.1-darwin-arm64.tar.gz" +url_api = "https://api.github.com/repos/googleapis/api-linter/releases/assets/375893868" +github_attestations = "unavailable" + +[tools."github:googleapis/api-linter"."platforms.macos-x64"] +checksum = "sha256:569019fce994f4b2a1689271c6e932857089222a63105f2ee877fc33851d9dc8" +url = "https://github.com/googleapis/api-linter/releases/download/v2.3.1/api-linter-2.3.1-darwin-amd64.tar.gz" +url_api = "https://api.github.com/repos/googleapis/api-linter/releases/assets/375893843" +github_attestations = "unavailable" + +[tools."github:googleapis/api-linter"."platforms.windows-x64"] +checksum = "sha256:da8e2154f96d9ec60c86fdb61b12e43e593a5ba17cbaab19a186f2f066bc796a" +url = "https://github.com/googleapis/api-linter/releases/download/v2.3.1/api-linter-2.3.1-windows-amd64.tar.gz" +url_api = "https://api.github.com/repos/googleapis/api-linter/releases/assets/375893870" +github_attestations = "unavailable" + [[tools.watchexec]] version = "2.5.1" backend = "aqua:watchexec/watchexec" From c8592cddfd0936e2a4abc9ef73ef17accc14ebfc Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 13 Jun 2026 07:51:38 +0000 Subject: [PATCH 06/13] feat(proto): redesign myfestival API as v1alpha with unified Review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rename package v1 → v1alpha (API still in design; other my-festival features pending). HTTP paths flip to /v1alpha/. Promotes to v1beta/v1 subsystem-by-subsystem as the design stabilises. - Merge Rating + Recommendation singletons into a single Review singleton (festivals/{festival}/drinks/{drink}/review). Eliminates 4 round trips per drink card and keeps both callers signals in one resource. - Add ListReviews for bulk pre-load on app open (parent=festivals/{f}). - Add ReviewSummary aggregate resource with ListReviewSummaries for whole-festival list/grid views. - Replace allow_missing (misleading no-op on singletons) with proper upsert semantics; update_mask now meaningful (star_rating vs would_recommend independently updatable). - Fix resource type hostname: data.cambeerfestival.app/* everywhere. - Add api-linter (googleapis/api-linter) to dev toolchain in mise.dev.toml. Suppressed: java options, delete-on-singleton (absent-until-written), resource-pattern-singular for reviewSummaries/{drink} natural key. - Delete rating.proto and recommendation.proto (superseded by review.proto). https://claude.ai/code/session_01WX7GbU19M9fh3tAfAxzeET --- mise.dev.toml | 5 +- proto/.api-linter.yaml | 13 +- .../myfestival/v1/my_festival_service.proto | 228 ------------------ .../myfestival/v1/rating.proto | 54 ----- .../myfestival/v1/recommendation.proto | 53 ---- .../v1alpha/my_festival_service.proto | 167 +++++++++++++ .../myfestival/v1alpha/review.proto | 70 ++++++ 7 files changed, 246 insertions(+), 344 deletions(-) delete mode 100644 proto/cambeerfestival/myfestival/v1/my_festival_service.proto delete mode 100644 proto/cambeerfestival/myfestival/v1/rating.proto delete mode 100644 proto/cambeerfestival/myfestival/v1/recommendation.proto create mode 100644 proto/cambeerfestival/myfestival/v1alpha/my_festival_service.proto create mode 100644 proto/cambeerfestival/myfestival/v1alpha/review.proto diff --git a/mise.dev.toml b/mise.dev.toml index 45a7c5ec..8b11278d 100644 --- a/mise.dev.toml +++ b/mise.dev.toml @@ -54,9 +54,8 @@ buf build -o /tmp/cambeerfestival.pb api-linter \ --config .api-linter.yaml \ --descriptor-set-in=/tmp/cambeerfestival.pb \ - cambeerfestival/myfestival/v1/my_festival_service.proto \ - cambeerfestival/myfestival/v1/rating.proto \ - cambeerfestival/myfestival/v1/recommendation.proto + cambeerfestival/myfestival/v1alpha/my_festival_service.proto \ + cambeerfestival/myfestival/v1alpha/review.proto """ # All tasks moved to mise-tasks/ for better maintainability and shellcheck/shfmt support: diff --git a/proto/.api-linter.yaml b/proto/.api-linter.yaml index 9fbd6965..bed0c4a0 100644 --- a/proto/.api-linter.yaml +++ b/proto/.api-linter.yaml @@ -4,13 +4,14 @@ # # 0191 java-*: Not building Java clients; Java file options are irrelevant. # -# 0156 forbidden-methods: Rating and Recommendation singletons expose Delete -# because a rating is absent until the caller rates something — these -# are not "always-present" singletons. See AIP-156 §absent-singletons. +# 0156 forbidden-methods: Review singleton exposes Delete because a review is +# absent until the caller writes one — it is not an always-present +# singleton. See AIP-156 §absent-singletons. # -# 0123 resource-pattern-singular: RatingSummary/RecommendationSummary use -# {drink} as the final URL segment (not {rating_summary}) so that the -# path reads as a natural key: .../ratingSummaries/{drinkId}. +# 0123 resource-pattern-singular: ReviewSummary uses {drink} as the final URL +# segment (not {review_summary}) so the path reads as a natural key: +# .../reviewSummaries/{drinkId}. The drink ID is the lookup key; the +# resource singular would obscure this. - disabled_rules: - core::0191::java-package - core::0191::java-multiple-files diff --git a/proto/cambeerfestival/myfestival/v1/my_festival_service.proto b/proto/cambeerfestival/myfestival/v1/my_festival_service.proto deleted file mode 100644 index 4b6dfc4b..00000000 --- a/proto/cambeerfestival/myfestival/v1/my_festival_service.proto +++ /dev/null @@ -1,228 +0,0 @@ -// Online "my festival" API: shared rating and recommendation aggregates. -syntax = "proto3"; - -package cambeerfestival.myfestival.v1; - -import "cambeerfestival/myfestival/v1/rating.proto"; -import "cambeerfestival/myfestival/v1/recommendation.proto"; -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; - -// Stores the caller's rating / "would recommend" answer for a drink and serves -// back the bucket-scoped aggregate. Writes are local-first on the client; this -// service holds the shared, cross-device aggregate. -// -// Rating and Recommendation are singleton resources — one per (caller, drink). -// The caller's identity is resolved from the auth context; it never appears in -// the resource name, keeping device IDs private and making the sign-in upgrade -// transparent to existing clients. -service MyFestivalService { - option (google.api.default_host) = "data.cambeerfestival.app"; - - // --- Ratings ------------------------------------------------------------- - // Get the caller's rating for a drink. - rpc GetRating(GetRatingRequest) returns (Rating) { - option (google.api.http) = {get: "/v1/{name=festivals/*/drinks/*/rating}"}; - option (google.api.method_signature) = "name"; - } - - // Create or update the caller's rating for a drink (upsert). - rpc UpdateRating(UpdateRatingRequest) returns (Rating) { - option (google.api.http) = { - patch: "/v1/{rating.name=festivals/*/drinks/*/rating}" - body: "rating" - }; - option (google.api.method_signature) = "rating,update_mask"; - } - - // Remove the caller's rating for a drink. - rpc DeleteRating(DeleteRatingRequest) returns (google.protobuf.Empty) { - option (google.api.http) = {delete: "/v1/{name=festivals/*/drinks/*/rating}"}; - option (google.api.method_signature) = "name"; - } - - // Get the aggregate rating for a single drink. - rpc GetRatingSummary(GetRatingSummaryRequest) returns (RatingSummary) { - option (google.api.http) = {get: "/v1/{name=festivals/*/ratingSummaries/*}"}; - option (google.api.method_signature) = "name"; - } - - // List aggregate ratings for every rated drink at a festival. - rpc ListRatingSummaries(ListRatingSummariesRequest) returns (ListRatingSummariesResponse) { - option (google.api.http) = {get: "/v1/{parent=festivals/*}/ratingSummaries"}; - option (google.api.method_signature) = "parent"; - } - - // --- Recommendations ----------------------------------------------------- - // Get the caller's "would recommend" answer for a drink. - rpc GetRecommendation(GetRecommendationRequest) returns (Recommendation) { - option (google.api.http) = {get: "/v1/{name=festivals/*/drinks/*/recommendation}"}; - option (google.api.method_signature) = "name"; - } - - // Create or update the caller's "would recommend" answer (upsert). - rpc UpdateRecommendation(UpdateRecommendationRequest) returns (Recommendation) { - option (google.api.http) = { - patch: "/v1/{recommendation.name=festivals/*/drinks/*/recommendation}" - body: "recommendation" - }; - option (google.api.method_signature) = "recommendation,update_mask"; - } - - // Remove the caller's "would recommend" answer for a drink. - rpc DeleteRecommendation(DeleteRecommendationRequest) returns (google.protobuf.Empty) { - option (google.api.http) = {delete: "/v1/{name=festivals/*/drinks/*/recommendation}"}; - option (google.api.method_signature) = "name"; - } - - // Get the aggregate recommendation for a single drink. - rpc GetRecommendationSummary(GetRecommendationSummaryRequest) returns (RecommendationSummary) { - option (google.api.http) = {get: "/v1/{name=festivals/*/recommendationSummaries/*}"}; - option (google.api.method_signature) = "name"; - } - - // List aggregate recommendations for every drink with an answer. - rpc ListRecommendationSummaries(ListRecommendationSummariesRequest) returns (ListRecommendationSummariesResponse) { - option (google.api.http) = {get: "/v1/{parent=festivals/*}/recommendationSummaries"}; - option (google.api.method_signature) = "parent"; - } -} - -// Request message for GetRating. -message GetRatingRequest { - // Resource name: festivals/{festival}/drinks/{drink}/rating. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "myfestival.cambeerfestival.app/Rating" - ]; -} - -// Request message for UpdateRating. -message UpdateRatingRequest { - // The rating to set. Its `name` identifies the resource. - Rating rating = 1 [(google.api.field_behavior) = REQUIRED]; - - // Fields to update; omit to update all populated fields. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Always an upsert for this singleton — the field is retained for - // AIP-134 generator compatibility but the server treats it as always true. - bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for DeleteRating. -message DeleteRatingRequest { - // Resource name: festivals/{festival}/drinks/{drink}/rating. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "myfestival.cambeerfestival.app/Rating" - ]; -} - -// Request message for GetRatingSummary. -message GetRatingSummaryRequest { - // Resource name: festivals/{festival}/ratingSummaries/{drink}. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "myfestival.cambeerfestival.app/RatingSummary" - ]; -} - -// Request message for ListRatingSummaries. -message ListRatingSummariesRequest { - // Parent festival: festivals/{festival}. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).child_type = "myfestival.cambeerfestival.app/RatingSummary" - ]; - - // Maximum number to return; the server may return fewer. Defaults applied - // when unset or zero. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Page token from a previous response. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for ListRatingSummaries. -message ListRatingSummariesResponse { - // Aggregate ratings for this page, one per rated drink. - repeated RatingSummary rating_summaries = 1; - - // Token for the next page; empty when there are no more. - string next_page_token = 2; - - // Total number of rated drinks at the festival. - int32 total_size = 3; -} - -// Request message for GetRecommendation. -message GetRecommendationRequest { - // Resource name: festivals/{festival}/drinks/{drink}/recommendation. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "myfestival.cambeerfestival.app/Recommendation" - ]; -} - -// Request message for UpdateRecommendation. -message UpdateRecommendationRequest { - // The answer to set. Its `name` identifies the resource. - Recommendation recommendation = 1 [(google.api.field_behavior) = REQUIRED]; - - // Fields to update; omit to update all populated fields. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Always an upsert for this singleton — retained for AIP-134 generator - // compatibility but the server treats it as always true. - bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for DeleteRecommendation. -message DeleteRecommendationRequest { - // Resource name: festivals/{festival}/drinks/{drink}/recommendation. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "myfestival.cambeerfestival.app/Recommendation" - ]; -} - -// Request message for GetRecommendationSummary. -message GetRecommendationSummaryRequest { - // Resource name: festivals/{festival}/recommendationSummaries/{drink}. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "myfestival.cambeerfestival.app/RecommendationSummary" - ]; -} - -// Request message for ListRecommendationSummaries. -message ListRecommendationSummariesRequest { - // Parent festival: festivals/{festival}. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).child_type = "myfestival.cambeerfestival.app/RecommendationSummary" - ]; - - // Maximum number to return; the server may return fewer. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Page token from a previous response. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for ListRecommendationSummaries. -message ListRecommendationSummariesResponse { - // Aggregate recommendations for this page, one per drink with an answer. - repeated RecommendationSummary recommendation_summaries = 1; - - // Token for the next page; empty when there are no more. - string next_page_token = 2; - - // Total number of drinks with at least one answer. - int32 total_size = 3; -} diff --git a/proto/cambeerfestival/myfestival/v1/rating.proto b/proto/cambeerfestival/myfestival/v1/rating.proto deleted file mode 100644 index e1af88d2..00000000 --- a/proto/cambeerfestival/myfestival/v1/rating.proto +++ /dev/null @@ -1,54 +0,0 @@ -// Aggregate drink ratings for the online "my festival" API. -syntax = "proto3"; - -package cambeerfestival.myfestival.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -// The caller's star rating for one drink at one festival. -// -// Singleton resource — there is exactly one rating per (caller, drink). The -// caller is implicit in the auth context; their identity never appears in the -// resource name, so device IDs stay private and the same URLs work unchanged -// when anonymous device tokens are replaced by signed-in user tokens. -message Rating { - option (google.api.resource) = { - type: "myfestival.cambeerfestival.app/Rating" - pattern: "festivals/{festival}/drinks/{drink}/rating" - singular: "rating" - plural: "ratings" - }; - - // Resource name: festivals/{festival}/drinks/{drink}/rating. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // The star rating, 1-5 inclusive. - int32 value = 2 [(google.api.field_behavior) = REQUIRED]; - - // When the rating was last set. - google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Computed, read-only aggregate of every caller's rating for one drink. -// -// Keyed by drink under the festival so the whole festival can be listed in one -// paginated call for list/grid views. -message RatingSummary { - option (google.api.resource) = { - type: "myfestival.cambeerfestival.app/RatingSummary" - pattern: "festivals/{festival}/ratingSummaries/{drink}" - singular: "ratingSummary" - plural: "ratingSummaries" - }; - - // Resource name: festivals/{festival}/ratingSummaries/{drink}. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Number of ratings contributing to the average. - int32 rating_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Mean rating across all callers (1.0-5.0); 0 when there are no ratings. - double average_rating = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/proto/cambeerfestival/myfestival/v1/recommendation.proto b/proto/cambeerfestival/myfestival/v1/recommendation.proto deleted file mode 100644 index 7995e9b9..00000000 --- a/proto/cambeerfestival/myfestival/v1/recommendation.proto +++ /dev/null @@ -1,53 +0,0 @@ -// "Would recommend" signal for the online "my festival" API. -syntax = "proto3"; - -package cambeerfestival.myfestival.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -// The caller's "would recommend" answer for one drink at one festival. -// -// Singleton resource — there is exactly one answer per (caller, drink). -// Caller identity is implicit in the auth context; device IDs never appear -// in the URL, and the same paths work unchanged after the sign-in upgrade. -message Recommendation { - option (google.api.resource) = { - type: "myfestival.cambeerfestival.app/Recommendation" - pattern: "festivals/{festival}/drinks/{drink}/recommendation" - singular: "recommendation" - plural: "recommendations" - }; - - // Resource name: festivals/{festival}/drinks/{drink}/recommendation. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Whether this caller would recommend the drink. - bool would_recommend = 2 [(google.api.field_behavior) = REQUIRED]; - - // When the answer was last set. - google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Computed, read-only aggregate of every caller's answer for one drink. -message RecommendationSummary { - option (google.api.resource) = { - type: "myfestival.cambeerfestival.app/RecommendationSummary" - pattern: "festivals/{festival}/recommendationSummaries/{drink}" - singular: "recommendationSummary" - plural: "recommendationSummaries" - }; - - // Resource name: festivals/{festival}/recommendationSummaries/{drink}. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Total number of yes/no responses. - int32 response_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Number of responses that would recommend. - int32 recommend_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Fraction (0.0-1.0) of responses that would recommend; 0 when none. - double recommend_rate = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/proto/cambeerfestival/myfestival/v1alpha/my_festival_service.proto b/proto/cambeerfestival/myfestival/v1alpha/my_festival_service.proto new file mode 100644 index 00000000..bbe26e71 --- /dev/null +++ b/proto/cambeerfestival/myfestival/v1alpha/my_festival_service.proto @@ -0,0 +1,167 @@ +// Online "my festival" API: personal reviews and shared aggregates. +syntax = "proto3"; + +package cambeerfestival.myfestival.v1alpha; + +import "cambeerfestival/myfestival/v1alpha/review.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +// Stores each caller's review (star rating + would-recommend) for drinks and +// serves back the bucket-scoped aggregates. Writes are local-first on the +// client; this service holds the shared, cross-device aggregate. +// +// Review is a singleton resource — one per (caller, drink). The caller's +// identity is resolved from the auth context; it never appears in the resource +// name, keeping device IDs private and making the sign-in upgrade transparent +// to existing clients. +service MyFestivalService { + option (google.api.default_host) = "data.cambeerfestival.app"; + + // --- Personal reviews (caller-scoped singletons) ------------------------- + // Get the caller's review for a drink. + rpc GetReview(GetReviewRequest) returns (Review) { + option (google.api.http) = {get: "/v1alpha/{name=festivals/*/drinks/*/review}"}; + option (google.api.method_signature) = "name"; + } + + // Create or update the caller's review for a drink (upsert). + // + // Use `update_mask` to update a single signal (e.g. only `star_rating`) + // without clearing the other. + rpc UpdateReview(UpdateReviewRequest) returns (Review) { + option (google.api.http) = { + patch: "/v1alpha/{review.name=festivals/*/drinks/*/review}" + body: "review" + }; + option (google.api.method_signature) = "review,update_mask"; + } + + // Remove the caller's review for a drink. + rpc DeleteReview(DeleteReviewRequest) returns (google.protobuf.Empty) { + option (google.api.http) = {delete: "/v1alpha/{name=festivals/*/drinks/*/review}"}; + option (google.api.method_signature) = "name"; + } + + // List all reviews the caller has left for drinks at a festival. + // + // Only the caller's own reviews are returned; caller identity is implicit in + // the auth context. Intended for pre-loading "my festival" state on app open. + rpc ListReviews(ListReviewsRequest) returns (ListReviewsResponse) { + option (google.api.http) = {get: "/v1alpha/{parent=festivals/*}/reviews"}; + option (google.api.method_signature) = "parent"; + } + + // --- Aggregates (public, not caller-scoped) -------------------------------- + // Get the aggregate review signals for a single drink. + rpc GetReviewSummary(GetReviewSummaryRequest) returns (ReviewSummary) { + option (google.api.http) = {get: "/v1alpha/{name=festivals/*/reviewSummaries/*}"}; + option (google.api.method_signature) = "name"; + } + + // List aggregate review signals for every reviewed drink at a festival. + rpc ListReviewSummaries(ListReviewSummariesRequest) returns (ListReviewSummariesResponse) { + option (google.api.http) = {get: "/v1alpha/{parent=festivals/*}/reviewSummaries"}; + option (google.api.method_signature) = "parent"; + } +} + +// Request message for GetReview. +message GetReviewRequest { + // Resource name: festivals/{festival}/drinks/{drink}/review. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "data.cambeerfestival.app/Review" + ]; +} + +// Request message for UpdateReview. +message UpdateReviewRequest { + // The review to write. Its `name` field identifies the resource. + Review review = 1 [(google.api.field_behavior) = REQUIRED]; + + // Fields to update. Omit to replace all writable fields. Specify + // `star_rating` or `would_recommend` individually to update one signal + // without affecting the other. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for DeleteReview. +message DeleteReviewRequest { + // Resource name: festivals/{festival}/drinks/{drink}/review. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "data.cambeerfestival.app/Review" + ]; +} + +// Request message for ListReviews. +message ListReviewsRequest { + // Parent festival: festivals/{festival}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).child_type = "data.cambeerfestival.app/Review" + ]; + + // Maximum number of reviews to return. The server default returns all of the + // caller's reviews for the festival in a single page (festival drink counts + // are bounded). Set explicitly to paginate. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Page token from a previous ListReviews response. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListReviews. +message ListReviewsResponse { + // The caller's reviews for this page, one per reviewed drink. + repeated Review reviews = 1; + + // Token for the next page; empty when there are no more results. + string next_page_token = 2; + + // Total number of drinks the caller has reviewed at this festival. + int32 total_size = 3; +} + +// Request message for GetReviewSummary. +message GetReviewSummaryRequest { + // Resource name: festivals/{festival}/reviewSummaries/{drink}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "data.cambeerfestival.app/ReviewSummary" + ]; +} + +// Request message for ListReviewSummaries. +message ListReviewSummariesRequest { + // Parent festival: festivals/{festival}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).child_type = "data.cambeerfestival.app/ReviewSummary" + ]; + + // Maximum number of summaries to return. The server default returns all + // summaries for the festival in a single page (drink counts are bounded). + // Set explicitly to paginate. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Page token from a previous ListReviewSummaries response. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListReviewSummaries. +message ListReviewSummariesResponse { + // Aggregate review signals for this page, one per reviewed drink. + repeated ReviewSummary review_summaries = 1; + + // Token for the next page; empty when there are no more results. + string next_page_token = 2; + + // Total number of drinks with at least one review at this festival. + int32 total_size = 3; +} diff --git a/proto/cambeerfestival/myfestival/v1alpha/review.proto b/proto/cambeerfestival/myfestival/v1alpha/review.proto new file mode 100644 index 00000000..0ed0e4ab --- /dev/null +++ b/proto/cambeerfestival/myfestival/v1alpha/review.proto @@ -0,0 +1,70 @@ +// Caller review signals for the online "my festival" API. +syntax = "proto3"; + +package cambeerfestival.myfestival.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +// The caller's review of one drink at one festival: a star rating (1-5) and/or +// a "would recommend" answer. +// +// Singleton resource — one per (caller, drink). The caller is implicit in the +// auth context; their identity never appears in the resource name, keeping +// device IDs private and making the sign-in upgrade transparent to clients. +// +// Both signals are optional and independent: a caller can rate without +// answering the recommendation question, or vice versa. +message Review { + option (google.api.resource) = { + type: "data.cambeerfestival.app/Review" + pattern: "festivals/{festival}/drinks/{drink}/review" + singular: "review" + plural: "reviews" + }; + + // Resource name: festivals/{festival}/drinks/{drink}/review. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Star rating, 1–5 inclusive. Absent if the caller has not set a star rating. + optional int32 star_rating = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Whether the caller would recommend this drink. Absent if not answered. + optional bool would_recommend = 3 [(google.api.field_behavior) = OPTIONAL]; + + // When this review was last written. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Computed, read-only aggregate of all callers' reviews for one drink. +// +// Keyed by drink under the festival so the whole festival can be fetched in +// one paginated call for list/grid views. +message ReviewSummary { + option (google.api.resource) = { + type: "data.cambeerfestival.app/ReviewSummary" + pattern: "festivals/{festival}/reviewSummaries/{drink}" + singular: "reviewSummary" + plural: "reviewSummaries" + }; + + // Resource name: festivals/{festival}/reviewSummaries/{drink}. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Number of callers who have submitted a star rating. + int32 rating_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Mean star rating across all callers (1.0–5.0); 0 when rating_count is 0. + double average_rating = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Number of callers who have answered the "would recommend" question. + int32 response_count = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Number of callers who answered "yes" to the recommendation question. + int32 recommend_count = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Fraction of responses (0.0–1.0) that would recommend; 0 when + // response_count is 0. + double recommend_rate = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} From 6c5367b30a9e11bf09edc92f614e6dc7c5a2a67e Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 13 Jun 2026 08:00:47 +0000 Subject: [PATCH 07/13] feat(proto): extend myfestival v1alpha to full personal state + api hostname Add Bookmark, Note, and Tasting singleton resources to round out the personal "my festival" state a caller can store per drink: Bookmark festivals/{festival}/drinks/{drink}/bookmark Presence = bookmarked; create_time only field. Note festivals/{festival}/drinks/{drink}/note Free-text tasting note (content, update_time). Tasting festivals/{festival}/drinks/{drink}/tasting Tried-it log with optional pours counter; create_time + update_time. Paired with TastingSummary aggregate (taster_count, total_pours) for social "N people tried this". Each resource gets Get/Update/Delete/List. All List RPCs are scoped to a parent festival for bulk pre-load on app open. Also: switch default_host and all resource type URIs from data.cambeerfestival.app to api.cambeerfestival.app. The data.* host is a static CDN; api.* will route to Workers for authenticated, dynamic endpoints. buf lint, buf format, and api-linter all pass clean. https://claude.ai/code/session_01WX7GbU19M9fh3tAfAxzeET --- mise.dev.toml | 5 +- .../myfestival/v1alpha/bookmark.proto | 28 ++ .../v1alpha/my_festival_service.proto | 341 +++++++++++++++++- .../myfestival/v1alpha/note.proto | 31 ++ .../myfestival/v1alpha/review.proto | 4 +- .../myfestival/v1alpha/tasting.proto | 57 +++ 6 files changed, 448 insertions(+), 18 deletions(-) create mode 100644 proto/cambeerfestival/myfestival/v1alpha/bookmark.proto create mode 100644 proto/cambeerfestival/myfestival/v1alpha/note.proto create mode 100644 proto/cambeerfestival/myfestival/v1alpha/tasting.proto diff --git a/mise.dev.toml b/mise.dev.toml index 8b11278d..0b5f9240 100644 --- a/mise.dev.toml +++ b/mise.dev.toml @@ -55,7 +55,10 @@ api-linter \ --config .api-linter.yaml \ --descriptor-set-in=/tmp/cambeerfestival.pb \ cambeerfestival/myfestival/v1alpha/my_festival_service.proto \ - cambeerfestival/myfestival/v1alpha/review.proto + cambeerfestival/myfestival/v1alpha/bookmark.proto \ + cambeerfestival/myfestival/v1alpha/note.proto \ + cambeerfestival/myfestival/v1alpha/review.proto \ + cambeerfestival/myfestival/v1alpha/tasting.proto """ # All tasks moved to mise-tasks/ for better maintainability and shellcheck/shfmt support: diff --git a/proto/cambeerfestival/myfestival/v1alpha/bookmark.proto b/proto/cambeerfestival/myfestival/v1alpha/bookmark.proto new file mode 100644 index 00000000..5020e36e --- /dev/null +++ b/proto/cambeerfestival/myfestival/v1alpha/bookmark.proto @@ -0,0 +1,28 @@ +// Caller bookmark ("favourite") signals for the online "my festival" API. +syntax = "proto3"; + +package cambeerfestival.myfestival.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +// A drink the caller has bookmarked at a festival. +// +// Singleton resource — one per (caller, drink). The resource's mere existence +// means the drink is bookmarked; deleting it removes the bookmark. The caller +// is implicit in the auth context. +message Bookmark { + option (google.api.resource) = { + type: "api.cambeerfestival.app/Bookmark" + pattern: "festivals/{festival}/drinks/{drink}/bookmark" + singular: "bookmark" + plural: "bookmarks" + }; + + // Resource name: festivals/{festival}/drinks/{drink}/bookmark. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // When the bookmark was created. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/proto/cambeerfestival/myfestival/v1alpha/my_festival_service.proto b/proto/cambeerfestival/myfestival/v1alpha/my_festival_service.proto index bbe26e71..8b6a6e42 100644 --- a/proto/cambeerfestival/myfestival/v1alpha/my_festival_service.proto +++ b/proto/cambeerfestival/myfestival/v1alpha/my_festival_service.proto @@ -1,9 +1,12 @@ -// Online "my festival" API: personal reviews and shared aggregates. +// Online "my festival" API: personal bookmarks, notes, tastings, reviews, and shared aggregates. syntax = "proto3"; package cambeerfestival.myfestival.v1alpha; +import "cambeerfestival/myfestival/v1alpha/bookmark.proto"; +import "cambeerfestival/myfestival/v1alpha/note.proto"; import "cambeerfestival/myfestival/v1alpha/review.proto"; +import "cambeerfestival/myfestival/v1alpha/tasting.proto"; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; @@ -11,18 +14,107 @@ import "google/api/resource.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; -// Stores each caller's review (star rating + would-recommend) for drinks and -// serves back the bucket-scoped aggregates. Writes are local-first on the -// client; this service holds the shared, cross-device aggregate. +// Stores each caller's personal festival state (bookmarks, notes, tastings, +// reviews) and serves back bucket-scoped aggregates. Writes are local-first on +// the client; this service holds the shared, cross-device state. // -// Review is a singleton resource — one per (caller, drink). The caller's -// identity is resolved from the auth context; it never appears in the resource -// name, keeping device IDs private and making the sign-in upgrade transparent -// to existing clients. +// All personal resources are singleton resources — one per (caller, drink). +// The caller's identity is resolved from the auth context; it never appears in +// resource names, keeping device IDs private and making the sign-in upgrade +// transparent to existing clients. service MyFestivalService { - option (google.api.default_host) = "data.cambeerfestival.app"; + option (google.api.default_host) = "api.cambeerfestival.app"; - // --- Personal reviews (caller-scoped singletons) ------------------------- + // --- Bookmarks (caller-scoped singletons) --------------------------------- + // Get the caller's bookmark for a drink. + rpc GetBookmark(GetBookmarkRequest) returns (Bookmark) { + option (google.api.http) = {get: "/v1alpha/{name=festivals/*/drinks/*/bookmark}"}; + option (google.api.method_signature) = "name"; + } + + // Create or update the caller's bookmark for a drink (upsert). + rpc UpdateBookmark(UpdateBookmarkRequest) returns (Bookmark) { + option (google.api.http) = { + patch: "/v1alpha/{bookmark.name=festivals/*/drinks/*/bookmark}" + body: "bookmark" + }; + option (google.api.method_signature) = "bookmark,update_mask"; + } + + // Remove the caller's bookmark for a drink. + rpc DeleteBookmark(DeleteBookmarkRequest) returns (google.protobuf.Empty) { + option (google.api.http) = {delete: "/v1alpha/{name=festivals/*/drinks/*/bookmark}"}; + option (google.api.method_signature) = "name"; + } + + // List all drinks the caller has bookmarked at a festival. + // + // Intended for pre-loading "my festival" state on app open. + rpc ListBookmarks(ListBookmarksRequest) returns (ListBookmarksResponse) { + option (google.api.http) = {get: "/v1alpha/{parent=festivals/*}/bookmarks"}; + option (google.api.method_signature) = "parent"; + } + + // --- Tasting notes (caller-scoped singletons) ----------------------------- + // Get the caller's tasting note for a drink. + rpc GetNote(GetNoteRequest) returns (Note) { + option (google.api.http) = {get: "/v1alpha/{name=festivals/*/drinks/*/note}"}; + option (google.api.method_signature) = "name"; + } + + // Create or update the caller's tasting note for a drink (upsert). + rpc UpdateNote(UpdateNoteRequest) returns (Note) { + option (google.api.http) = { + patch: "/v1alpha/{note.name=festivals/*/drinks/*/note}" + body: "note" + }; + option (google.api.method_signature) = "note,update_mask"; + } + + // Remove the caller's tasting note for a drink. + rpc DeleteNote(DeleteNoteRequest) returns (google.protobuf.Empty) { + option (google.api.http) = {delete: "/v1alpha/{name=festivals/*/drinks/*/note}"}; + option (google.api.method_signature) = "name"; + } + + // List all tasting notes the caller has written at a festival. + rpc ListNotes(ListNotesRequest) returns (ListNotesResponse) { + option (google.api.http) = {get: "/v1alpha/{parent=festivals/*}/notes"}; + option (google.api.method_signature) = "parent"; + } + + // --- Tasting log (caller-scoped singletons) ------------------------------- + // Get the caller's tasting record for a drink. + rpc GetTasting(GetTastingRequest) returns (Tasting) { + option (google.api.http) = {get: "/v1alpha/{name=festivals/*/drinks/*/tasting}"}; + option (google.api.method_signature) = "name"; + } + + // Create or update the caller's tasting record for a drink (upsert). + // + // Use `update_mask` with `pours` to increment the pour count without + // affecting other fields. + rpc UpdateTasting(UpdateTastingRequest) returns (Tasting) { + option (google.api.http) = { + patch: "/v1alpha/{tasting.name=festivals/*/drinks/*/tasting}" + body: "tasting" + }; + option (google.api.method_signature) = "tasting,update_mask"; + } + + // Remove the caller's tasting record for a drink. + rpc DeleteTasting(DeleteTastingRequest) returns (google.protobuf.Empty) { + option (google.api.http) = {delete: "/v1alpha/{name=festivals/*/drinks/*/tasting}"}; + option (google.api.method_signature) = "name"; + } + + // List all tasting records the caller has logged at a festival. + rpc ListTastings(ListTastingsRequest) returns (ListTastingsResponse) { + option (google.api.http) = {get: "/v1alpha/{parent=festivals/*}/tastings"}; + option (google.api.method_signature) = "parent"; + } + + // --- Personal reviews (caller-scoped singletons) -------------------------- // Get the caller's review for a drink. rpc GetReview(GetReviewRequest) returns (Review) { option (google.api.http) = {get: "/v1alpha/{name=festivals/*/drinks/*/review}"}; @@ -68,6 +160,187 @@ service MyFestivalService { option (google.api.http) = {get: "/v1alpha/{parent=festivals/*}/reviewSummaries"}; option (google.api.method_signature) = "parent"; } + + // Get tasting counts for a single drink. + rpc GetTastingSummary(GetTastingSummaryRequest) returns (TastingSummary) { + option (google.api.http) = {get: "/v1alpha/{name=festivals/*/tastingSummaries/*}"}; + option (google.api.method_signature) = "name"; + } + + // List tasting counts for every tried drink at a festival. + rpc ListTastingSummaries(ListTastingSummariesRequest) returns (ListTastingSummariesResponse) { + option (google.api.http) = {get: "/v1alpha/{parent=festivals/*}/tastingSummaries"}; + option (google.api.method_signature) = "parent"; + } +} + +// Request message for GetBookmark. +message GetBookmarkRequest { + // Resource name: festivals/{festival}/drinks/{drink}/bookmark. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "api.cambeerfestival.app/Bookmark" + ]; +} + +// Request message for UpdateBookmark. +message UpdateBookmarkRequest { + // The bookmark to write. Its `name` field identifies the resource. + Bookmark bookmark = 1 [(google.api.field_behavior) = REQUIRED]; + + // Fields to update. Omit to replace all writable fields. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for DeleteBookmark. +message DeleteBookmarkRequest { + // Resource name: festivals/{festival}/drinks/{drink}/bookmark. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "api.cambeerfestival.app/Bookmark" + ]; +} + +// Request message for ListBookmarks. +message ListBookmarksRequest { + // Parent festival: festivals/{festival}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).child_type = "api.cambeerfestival.app/Bookmark" + ]; + + // Maximum number of bookmarks to return. The server default returns all of + // the caller's bookmarks for the festival in a single page (festival drink + // counts are bounded). Set explicitly to paginate. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Page token from a previous ListBookmarks response. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListBookmarks. +message ListBookmarksResponse { + // The caller's bookmarks for this page, one per bookmarked drink. + repeated Bookmark bookmarks = 1; + + // Token for the next page; empty when there are no more results. + string next_page_token = 2; + + // Total number of drinks the caller has bookmarked at this festival. + int32 total_size = 3; +} + +// Request message for GetNote. +message GetNoteRequest { + // Resource name: festivals/{festival}/drinks/{drink}/note. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "api.cambeerfestival.app/Note" + ]; +} + +// Request message for UpdateNote. +message UpdateNoteRequest { + // The note to write. Its `name` field identifies the resource. + Note note = 1 [(google.api.field_behavior) = REQUIRED]; + + // Fields to update. Omit to replace all writable fields. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for DeleteNote. +message DeleteNoteRequest { + // Resource name: festivals/{festival}/drinks/{drink}/note. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "api.cambeerfestival.app/Note" + ]; +} + +// Request message for ListNotes. +message ListNotesRequest { + // Parent festival: festivals/{festival}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).child_type = "api.cambeerfestival.app/Note" + ]; + + // Maximum number of notes to return. The server default returns all of the + // caller's notes for the festival in a single page (festival drink counts + // are bounded). Set explicitly to paginate. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Page token from a previous ListNotes response. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListNotes. +message ListNotesResponse { + // The caller's notes for this page, one per noted drink. + repeated Note notes = 1; + + // Token for the next page; empty when there are no more results. + string next_page_token = 2; + + // Total number of drinks the caller has notes for at this festival. + int32 total_size = 3; +} + +// Request message for GetTasting. +message GetTastingRequest { + // Resource name: festivals/{festival}/drinks/{drink}/tasting. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "api.cambeerfestival.app/Tasting" + ]; +} + +// Request message for UpdateTasting. +message UpdateTastingRequest { + // The tasting record to write. Its `name` field identifies the resource. + Tasting tasting = 1 [(google.api.field_behavior) = REQUIRED]; + + // Fields to update. Omit to replace all writable fields. Specify `pours` + // to update the pour count without affecting other fields. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for DeleteTasting. +message DeleteTastingRequest { + // Resource name: festivals/{festival}/drinks/{drink}/tasting. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "api.cambeerfestival.app/Tasting" + ]; +} + +// Request message for ListTastings. +message ListTastingsRequest { + // Parent festival: festivals/{festival}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).child_type = "api.cambeerfestival.app/Tasting" + ]; + + // Maximum number of tastings to return. The server default returns all of + // the caller's tastings for the festival in a single page (festival drink + // counts are bounded). Set explicitly to paginate. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Page token from a previous ListTastings response. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListTastings. +message ListTastingsResponse { + // The caller's tasting records for this page, one per tried drink. + repeated Tasting tastings = 1; + + // Token for the next page; empty when there are no more results. + string next_page_token = 2; + + // Total number of drinks the caller has tried at this festival. + int32 total_size = 3; } // Request message for GetReview. @@ -75,7 +348,7 @@ message GetReviewRequest { // Resource name: festivals/{festival}/drinks/{drink}/review. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "data.cambeerfestival.app/Review" + (google.api.resource_reference).type = "api.cambeerfestival.app/Review" ]; } @@ -95,7 +368,7 @@ message DeleteReviewRequest { // Resource name: festivals/{festival}/drinks/{drink}/review. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "data.cambeerfestival.app/Review" + (google.api.resource_reference).type = "api.cambeerfestival.app/Review" ]; } @@ -104,7 +377,7 @@ message ListReviewsRequest { // Parent festival: festivals/{festival}. string parent = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).child_type = "data.cambeerfestival.app/Review" + (google.api.resource_reference).child_type = "api.cambeerfestival.app/Review" ]; // Maximum number of reviews to return. The server default returns all of the @@ -133,7 +406,7 @@ message GetReviewSummaryRequest { // Resource name: festivals/{festival}/reviewSummaries/{drink}. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "data.cambeerfestival.app/ReviewSummary" + (google.api.resource_reference).type = "api.cambeerfestival.app/ReviewSummary" ]; } @@ -142,7 +415,7 @@ message ListReviewSummariesRequest { // Parent festival: festivals/{festival}. string parent = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).child_type = "data.cambeerfestival.app/ReviewSummary" + (google.api.resource_reference).child_type = "api.cambeerfestival.app/ReviewSummary" ]; // Maximum number of summaries to return. The server default returns all @@ -165,3 +438,41 @@ message ListReviewSummariesResponse { // Total number of drinks with at least one review at this festival. int32 total_size = 3; } + +// Request message for GetTastingSummary. +message GetTastingSummaryRequest { + // Resource name: festivals/{festival}/tastingSummaries/{drink}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "api.cambeerfestival.app/TastingSummary" + ]; +} + +// Request message for ListTastingSummaries. +message ListTastingSummariesRequest { + // Parent festival: festivals/{festival}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).child_type = "api.cambeerfestival.app/TastingSummary" + ]; + + // Maximum number of summaries to return. The server default returns all + // summaries for the festival in a single page (drink counts are bounded). + // Set explicitly to paginate. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Page token from a previous ListTastingSummaries response. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListTastingSummaries. +message ListTastingSummariesResponse { + // Tasting counts for this page, one per tried drink. + repeated TastingSummary tasting_summaries = 1; + + // Token for the next page; empty when there are no more results. + string next_page_token = 2; + + // Total number of drinks tried by at least one caller at this festival. + int32 total_size = 3; +} diff --git a/proto/cambeerfestival/myfestival/v1alpha/note.proto b/proto/cambeerfestival/myfestival/v1alpha/note.proto new file mode 100644 index 00000000..b7d8f866 --- /dev/null +++ b/proto/cambeerfestival/myfestival/v1alpha/note.proto @@ -0,0 +1,31 @@ +// Caller tasting note for the online "my festival" API. +syntax = "proto3"; + +package cambeerfestival.myfestival.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +// The caller's free-text tasting note for one drink at one festival. +// +// Singleton resource — one per (caller, drink). The caller is implicit in the +// auth context. A note is independent of a Review: you can note without rating, +// or rate without noting. +message Note { + option (google.api.resource) = { + type: "api.cambeerfestival.app/Note" + pattern: "festivals/{festival}/drinks/{drink}/note" + singular: "note" + plural: "notes" + }; + + // Resource name: festivals/{festival}/drinks/{drink}/note. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The caller's note text. Max 2000 Unicode characters. + string content = 2 [(google.api.field_behavior) = REQUIRED]; + + // When this note was last written. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/proto/cambeerfestival/myfestival/v1alpha/review.proto b/proto/cambeerfestival/myfestival/v1alpha/review.proto index 0ed0e4ab..57c1c774 100644 --- a/proto/cambeerfestival/myfestival/v1alpha/review.proto +++ b/proto/cambeerfestival/myfestival/v1alpha/review.proto @@ -18,7 +18,7 @@ import "google/protobuf/timestamp.proto"; // answering the recommendation question, or vice versa. message Review { option (google.api.resource) = { - type: "data.cambeerfestival.app/Review" + type: "api.cambeerfestival.app/Review" pattern: "festivals/{festival}/drinks/{drink}/review" singular: "review" plural: "reviews" @@ -43,7 +43,7 @@ message Review { // one paginated call for list/grid views. message ReviewSummary { option (google.api.resource) = { - type: "data.cambeerfestival.app/ReviewSummary" + type: "api.cambeerfestival.app/ReviewSummary" pattern: "festivals/{festival}/reviewSummaries/{drink}" singular: "reviewSummary" plural: "reviewSummaries" diff --git a/proto/cambeerfestival/myfestival/v1alpha/tasting.proto b/proto/cambeerfestival/myfestival/v1alpha/tasting.proto new file mode 100644 index 00000000..739b1040 --- /dev/null +++ b/proto/cambeerfestival/myfestival/v1alpha/tasting.proto @@ -0,0 +1,57 @@ +// Caller tasting log and festival-wide tasting counts for the online "my festival" API. +syntax = "proto3"; + +package cambeerfestival.myfestival.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +// A record that the caller has tried a drink at a festival. +// +// Singleton resource — one per (caller, drink). The caller is implicit in the +// auth context. `pours` tracks how many times the caller has had this drink at +// the festival (e.g. returned for a second half-pint); absent means one pour. +message Tasting { + option (google.api.resource) = { + type: "api.cambeerfestival.app/Tasting" + pattern: "festivals/{festival}/drinks/{drink}/tasting" + singular: "tasting" + plural: "tastings" + }; + + // Resource name: festivals/{festival}/drinks/{drink}/tasting. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // How many times the caller has had this drink. Absent means one pour. + // Must be >= 1 when present. + optional int32 pours = 2 [(google.api.field_behavior) = OPTIONAL]; + + // When the caller first tried this drink. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // When this record was last updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Computed, read-only aggregate of how many callers have tried a drink. +// +// Useful for social discovery ("N people have tried this"). Keyed by drink +// under the festival, matching the ReviewSummary pattern. +message TastingSummary { + option (google.api.resource) = { + type: "api.cambeerfestival.app/TastingSummary" + pattern: "festivals/{festival}/tastingSummaries/{drink}" + singular: "tastingSummary" + plural: "tastingSummaries" + }; + + // Resource name: festivals/{festival}/tastingSummaries/{drink}. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Number of distinct callers who have logged a tasting for this drink. + int32 taster_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Total pours logged across all callers. + int32 total_pours = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} From e14cb6596781bce0da20c8f0684646b04626cac4 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 13 Jun 2026 08:09:04 +0000 Subject: [PATCH 08/13] =?UTF-8?q?feat(proto):=20add=20proto=E2=86=92OpenAP?= =?UTF-8?q?I=E2=86=92clients=20generation=20pipeline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Full pipeline: proto → OpenAPI → Worker TS types + Flutter Dart client. ## proto → OpenAPI (buf generate) - Add `option go_package` to all v1alpha proto files (required by the gnostic-openapi BSR plugin for import resolution) - `buf generate` now produces `docs/code/api/openapi/openapi.yaml` (899 lines, OpenAPI 3.0.3, server: https://api.cambeerfestival.app) ## OpenAPI → Worker TypeScript types - Add `openapi-typescript` as devDep in `cloudflare-worker/` - `proto:clients:types` task generates `cloudflare-worker/src/api-types.ts` (1051 lines of fully-typed path/operation/component interfaces) ## OpenAPI → Flutter Dart client (packages/myfestival_client) - `proto:clients:dart` task downloads openapi-generator-cli 7.13.0 JAR (cached to ~/.cache/openapi-generator/) and generates a `dart-dio` package at `packages/myfestival_client/` - Runs `dart pub get` + `dart run build_runner build` inside the package to produce the built_value `.g.dart` serialization files - Root `.gitignore` updated: `!packages/**/*.g.dart` exception allows generated package serializers to be committed alongside their source - `pubspec.yaml`: add `myfestival_client: {path: packages/myfestival_client}` as a path dependency (resolves cleanly with `flutter pub get`) ## Mise tasks - `proto:clients` — chains types + dart - `proto:clients:types` — openapi-typescript → api-types.ts - `proto:clients:dart` — JAR download + openapi-generator + build_runner https://claude.ai/code/session_01WX7GbU19M9fh3tAfAxzeET --- .gitignore | 4 +- cloudflare-worker/package-lock.json | 350 ++++ cloudflare-worker/package.json | 1 + cloudflare-worker/src/api-types.ts | 1051 +++++++++++ docs/code/api/openapi/openapi.yaml | 899 +++++++++ mise.dev.toml | 33 + packages/myfestival_client/.gitignore | 41 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 55 + .../.openapi-generator/VERSION | 1 + packages/myfestival_client/README.md | 121 ++ .../myfestival_client/analysis_options.yaml | 9 + packages/myfestival_client/doc/Bookmark.md | 16 + .../doc/ListBookmarksResponse.md | 17 + .../doc/ListNotesResponse.md | 17 + .../doc/ListReviewSummariesResponse.md | 17 + .../doc/ListReviewsResponse.md | 17 + .../doc/ListTastingSummariesResponse.md | 17 + .../doc/ListTastingsResponse.md | 17 + .../doc/MyFestivalServiceApi.md | 957 ++++++++++ packages/myfestival_client/doc/Note.md | 17 + packages/myfestival_client/doc/Review.md | 18 + .../myfestival_client/doc/ReviewSummary.md | 20 + packages/myfestival_client/doc/Tasting.md | 18 + .../myfestival_client/doc/TastingSummary.md | 17 + .../lib/myfestival_client.dart | 27 + packages/myfestival_client/lib/src/api.dart | 73 + .../lib/src/api/my_festival_service_api.dart | 1629 +++++++++++++++++ .../myfestival_client/lib/src/api_util.dart | 77 + .../lib/src/auth/api_key_auth.dart | 30 + .../myfestival_client/lib/src/auth/auth.dart | 18 + .../lib/src/auth/basic_auth.dart | 37 + .../lib/src/auth/bearer_auth.dart | 26 + .../myfestival_client/lib/src/auth/oauth.dart | 26 + .../lib/src/date_serializer.dart | 31 + .../lib/src/model/bookmark.dart | 128 ++ .../lib/src/model/bookmark.g.dart | 101 + .../myfestival_client/lib/src/model/date.dart | 70 + .../src/model/list_bookmarks_response.dart | 149 ++ .../src/model/list_bookmarks_response.g.dart | 134 ++ .../lib/src/model/list_notes_response.dart | 149 ++ .../lib/src/model/list_notes_response.g.dart | 130 ++ .../model/list_review_summaries_response.dart | 149 ++ .../list_review_summaries_response.g.dart | 136 ++ .../lib/src/model/list_reviews_response.dart | 149 ++ .../src/model/list_reviews_response.g.dart | 131 ++ .../list_tasting_summaries_response.dart | 149 ++ .../list_tasting_summaries_response.g.dart | 136 ++ .../lib/src/model/list_tastings_response.dart | 149 ++ .../src/model/list_tastings_response.g.dart | 132 ++ .../myfestival_client/lib/src/model/note.dart | 145 ++ .../lib/src/model/note.g.dart | 113 ++ .../lib/src/model/review.dart | 166 ++ .../lib/src/model/review.g.dart | 125 ++ .../lib/src/model/review_summary.dart | 204 +++ .../lib/src/model/review_summary.g.dart | 157 ++ .../lib/src/model/tasting.dart | 166 ++ .../lib/src/model/tasting.g.dart | 124 ++ .../lib/src/model/tasting_summary.dart | 147 ++ .../lib/src/model/tasting_summary.g.dart | 114 ++ .../lib/src/serializers.dart | 54 + .../lib/src/serializers.g.dart | 42 + packages/myfestival_client/pubspec.yaml | 20 + .../myfestival_client/test/bookmark_test.dart | 23 + .../test/list_bookmarks_response_test.dart | 29 + .../test/list_notes_response_test.dart | 29 + .../list_review_summaries_response_test.dart | 29 + .../test/list_reviews_response_test.dart | 29 + .../list_tasting_summaries_response_test.dart | 29 + .../test/list_tastings_response_test.dart | 29 + .../test/my_festival_service_api_test.dart | 151 ++ .../myfestival_client/test/note_test.dart | 29 + .../test/review_summary_test.dart | 47 + .../myfestival_client/test/review_test.dart | 35 + .../test/tasting_summary_test.dart | 29 + .../myfestival_client/test/tasting_test.dart | 35 + .../myfestival/v1alpha/bookmark.proto | 2 + .../v1alpha/my_festival_service.proto | 2 + .../myfestival/v1alpha/note.proto | 2 + .../myfestival/v1alpha/review.proto | 2 + .../myfestival/v1alpha/tasting.proto | 2 + pubspec.lock | 47 + pubspec.yaml | 2 + 83 files changed, 9877 insertions(+), 1 deletion(-) create mode 100644 cloudflare-worker/src/api-types.ts create mode 100644 docs/code/api/openapi/openapi.yaml create mode 100644 packages/myfestival_client/.gitignore create mode 100644 packages/myfestival_client/.openapi-generator-ignore create mode 100644 packages/myfestival_client/.openapi-generator/FILES create mode 100644 packages/myfestival_client/.openapi-generator/VERSION create mode 100644 packages/myfestival_client/README.md create mode 100644 packages/myfestival_client/analysis_options.yaml create mode 100644 packages/myfestival_client/doc/Bookmark.md create mode 100644 packages/myfestival_client/doc/ListBookmarksResponse.md create mode 100644 packages/myfestival_client/doc/ListNotesResponse.md create mode 100644 packages/myfestival_client/doc/ListReviewSummariesResponse.md create mode 100644 packages/myfestival_client/doc/ListReviewsResponse.md create mode 100644 packages/myfestival_client/doc/ListTastingSummariesResponse.md create mode 100644 packages/myfestival_client/doc/ListTastingsResponse.md create mode 100644 packages/myfestival_client/doc/MyFestivalServiceApi.md create mode 100644 packages/myfestival_client/doc/Note.md create mode 100644 packages/myfestival_client/doc/Review.md create mode 100644 packages/myfestival_client/doc/ReviewSummary.md create mode 100644 packages/myfestival_client/doc/Tasting.md create mode 100644 packages/myfestival_client/doc/TastingSummary.md create mode 100644 packages/myfestival_client/lib/myfestival_client.dart create mode 100644 packages/myfestival_client/lib/src/api.dart create mode 100644 packages/myfestival_client/lib/src/api/my_festival_service_api.dart create mode 100644 packages/myfestival_client/lib/src/api_util.dart create mode 100644 packages/myfestival_client/lib/src/auth/api_key_auth.dart create mode 100644 packages/myfestival_client/lib/src/auth/auth.dart create mode 100644 packages/myfestival_client/lib/src/auth/basic_auth.dart create mode 100644 packages/myfestival_client/lib/src/auth/bearer_auth.dart create mode 100644 packages/myfestival_client/lib/src/auth/oauth.dart create mode 100644 packages/myfestival_client/lib/src/date_serializer.dart create mode 100644 packages/myfestival_client/lib/src/model/bookmark.dart create mode 100644 packages/myfestival_client/lib/src/model/bookmark.g.dart create mode 100644 packages/myfestival_client/lib/src/model/date.dart create mode 100644 packages/myfestival_client/lib/src/model/list_bookmarks_response.dart create mode 100644 packages/myfestival_client/lib/src/model/list_bookmarks_response.g.dart create mode 100644 packages/myfestival_client/lib/src/model/list_notes_response.dart create mode 100644 packages/myfestival_client/lib/src/model/list_notes_response.g.dart create mode 100644 packages/myfestival_client/lib/src/model/list_review_summaries_response.dart create mode 100644 packages/myfestival_client/lib/src/model/list_review_summaries_response.g.dart create mode 100644 packages/myfestival_client/lib/src/model/list_reviews_response.dart create mode 100644 packages/myfestival_client/lib/src/model/list_reviews_response.g.dart create mode 100644 packages/myfestival_client/lib/src/model/list_tasting_summaries_response.dart create mode 100644 packages/myfestival_client/lib/src/model/list_tasting_summaries_response.g.dart create mode 100644 packages/myfestival_client/lib/src/model/list_tastings_response.dart create mode 100644 packages/myfestival_client/lib/src/model/list_tastings_response.g.dart create mode 100644 packages/myfestival_client/lib/src/model/note.dart create mode 100644 packages/myfestival_client/lib/src/model/note.g.dart create mode 100644 packages/myfestival_client/lib/src/model/review.dart create mode 100644 packages/myfestival_client/lib/src/model/review.g.dart create mode 100644 packages/myfestival_client/lib/src/model/review_summary.dart create mode 100644 packages/myfestival_client/lib/src/model/review_summary.g.dart create mode 100644 packages/myfestival_client/lib/src/model/tasting.dart create mode 100644 packages/myfestival_client/lib/src/model/tasting.g.dart create mode 100644 packages/myfestival_client/lib/src/model/tasting_summary.dart create mode 100644 packages/myfestival_client/lib/src/model/tasting_summary.g.dart create mode 100644 packages/myfestival_client/lib/src/serializers.dart create mode 100644 packages/myfestival_client/lib/src/serializers.g.dart create mode 100644 packages/myfestival_client/pubspec.yaml create mode 100644 packages/myfestival_client/test/bookmark_test.dart create mode 100644 packages/myfestival_client/test/list_bookmarks_response_test.dart create mode 100644 packages/myfestival_client/test/list_notes_response_test.dart create mode 100644 packages/myfestival_client/test/list_review_summaries_response_test.dart create mode 100644 packages/myfestival_client/test/list_reviews_response_test.dart create mode 100644 packages/myfestival_client/test/list_tasting_summaries_response_test.dart create mode 100644 packages/myfestival_client/test/list_tastings_response_test.dart create mode 100644 packages/myfestival_client/test/my_festival_service_api_test.dart create mode 100644 packages/myfestival_client/test/note_test.dart create mode 100644 packages/myfestival_client/test/review_summary_test.dart create mode 100644 packages/myfestival_client/test/review_test.dart create mode 100644 packages/myfestival_client/test/tasting_summary_test.dart create mode 100644 packages/myfestival_client/test/tasting_test.dart diff --git a/.gitignore b/.gitignore index ca2fdc83..4bf5246b 100644 --- a/.gitignore +++ b/.gitignore @@ -41,10 +41,12 @@ build/ !mise-tasks/build/ flutter_*.png -# Generated files (build_runner) +# Generated files (build_runner) — excluded for main app, but committed for generated packages *.g.dart *.freezed.dart *.mocks.dart +# Allow .g.dart inside generated packages (they must be committed alongside their source) +!packages/**/*.g.dart # Android related **/android/**/gradle-wrapper.jar diff --git a/cloudflare-worker/package-lock.json b/cloudflare-worker/package-lock.json index f1ac5a3e..bb0998a7 100644 --- a/cloudflare-worker/package-lock.json +++ b/cloudflare-worker/package-lock.json @@ -9,10 +9,36 @@ "version": "1.0.0", "devDependencies": { "@cloudflare/vitest-pool-workers": "^0.16.13", + "openapi-typescript": "^7.13.0", "vitest": "^4.1.8", "wrangler": "^4.88.0" } }, + "node_modules/@babel/code-frame": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@cloudflare/kv-asset-handler": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.5.0.tgz", @@ -1208,6 +1234,52 @@ "dev": true, "license": "MIT" }, + "node_modules/@redocly/ajv": { + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/@redocly/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-io1JpnwtIcvojV7QKDUSIuMN/ikdOUd1ReEnUnMKGfDVridQZ31J0MmIuqwuRjWDZfmvr+Q0MqCcfHM2gTivOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js-replace": "^1.0.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@redocly/config": { + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/@redocly/config/-/config-0.22.0.tgz", + "integrity": "sha512-gAy93Ddo01Z3bHuVdPWfCwzgfaYgMdaZPcfL7JZ7hWJoK9V0lXDbigTWkhiPFAaLWzbOJ+kbUQG1+XwIm0KRGQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@redocly/openapi-core": { + "version": "1.34.15", + "resolved": "https://registry.npmjs.org/@redocly/openapi-core/-/openapi-core-1.34.15.tgz", + "integrity": "sha512-HAwCnNyKcs5XGQqms+9t7OdAPM/5TDstmhF+0i7tdCFato2QKuYIlyWETwkXd8c5zbltr1oB+6y9NTeQLr2d6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@redocly/ajv": "8.11.2", + "@redocly/config": "0.22.0", + "colorette": "1.4.0", + "https-proxy-agent": "7.0.6", + "js-levenshtein": "1.1.6", + "js-yaml": "4.1.1", + "minimatch": "5.1.9", + "pluralize": "8.0.0", + "yaml-ast-parser": "0.0.43" + }, + "engines": { + "node": ">=18.17.0", + "npm": ">=9.5.0" + } + }, "node_modules/@rolldown/binding-android-arm64": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.3.tgz", @@ -1648,6 +1720,33 @@ "url": "https://opencollective.com/vitest" } }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, "node_modules/assertion-error": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", @@ -1658,6 +1757,13 @@ "node": ">=12" } }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, "node_modules/blake3-wasm": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz", @@ -1665,6 +1771,16 @@ "dev": true, "license": "MIT" }, + "node_modules/brace-expansion": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.1.tgz", + "integrity": "sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, "node_modules/chai": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz", @@ -1675,6 +1791,13 @@ "node": ">=18" } }, + "node_modules/change-case": { + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", + "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==", + "dev": true, + "license": "MIT" + }, "node_modules/cjs-module-lexer": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", @@ -1682,6 +1805,13 @@ "dev": true, "license": "MIT" }, + "node_modules/colorette": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", + "dev": true, + "license": "MIT" + }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -1703,6 +1833,24 @@ "url": "https://opencollective.com/express" } }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/detect-libc": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", @@ -1792,6 +1940,13 @@ "node": ">=12.0.0" } }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, "node_modules/fdir": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", @@ -1825,6 +1980,70 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/index-to-position": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-1.2.0.tgz", + "integrity": "sha512-Yg7+ztRkqslMAS2iFaU+Oa4KTSidr63OsFGlOrJoW981kIYO3CGCS3wA95P1mUi/IVSJkn0D479KTJpVpvFNuw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/js-levenshtein": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", + "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT" + }, "node_modules/kleur": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", @@ -2127,6 +2346,26 @@ "node": ">=22.0.0" } }, + "node_modules/minimatch": { + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, "node_modules/nanoid": { "version": "3.3.12", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz", @@ -2157,6 +2396,45 @@ ], "license": "MIT" }, + "node_modules/openapi-typescript": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/openapi-typescript/-/openapi-typescript-7.13.0.tgz", + "integrity": "sha512-EFP392gcqXS7ntPvbhBzbF8TyBA+baIYEm791Hy5YkjDYKTnk/Tn5OQeKm5BIZvJihpp8Zzr4hzx0Irde1LNGQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@redocly/openapi-core": "^1.34.6", + "ansi-colors": "^4.1.3", + "change-case": "^5.4.4", + "parse-json": "^8.3.0", + "supports-color": "^10.2.2", + "yargs-parser": "^21.1.1" + }, + "bin": { + "openapi-typescript": "bin/cli.js" + }, + "peerDependencies": { + "typescript": "^5.x" + } + }, + "node_modules/parse-json": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.3.0.tgz", + "integrity": "sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "index-to-position": "^1.1.0", + "type-fest": "^4.39.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/path-to-regexp": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", @@ -2191,6 +2469,16 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/postcss": { "version": "8.5.15", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.15.tgz", @@ -2220,6 +2508,16 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/rolldown": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.3.tgz", @@ -2408,6 +2706,34 @@ "license": "0BSD", "optional": true }, + "node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/undici": { "version": "7.24.8", "resolved": "https://registry.npmjs.org/undici/-/undici-7.24.8.tgz", @@ -2428,6 +2754,13 @@ "pathe": "^2.0.3" } }, + "node_modules/uri-js-replace": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uri-js-replace/-/uri-js-replace-1.0.1.tgz", + "integrity": "sha512-W+C9NWNLFOoBI2QWDp4UT9pv65r2w5Cx+3sTYFvtMdDBxkKt1syCqsUdSFAChbEe1uK5TfS04wt/nGwmaeIQ0g==", + "dev": true, + "license": "MIT" + }, "node_modules/vite": { "version": "8.0.16", "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.16.tgz", @@ -2691,6 +3024,23 @@ } } }, + "node_modules/yaml-ast-parser": { + "version": "0.0.43", + "resolved": "https://registry.npmjs.org/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz", + "integrity": "sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/youch": { "version": "4.1.0-beta.10", "resolved": "https://registry.npmjs.org/youch/-/youch-4.1.0-beta.10.tgz", diff --git a/cloudflare-worker/package.json b/cloudflare-worker/package.json index e7a56aa9..e936b55f 100644 --- a/cloudflare-worker/package.json +++ b/cloudflare-worker/package.json @@ -11,6 +11,7 @@ }, "devDependencies": { "@cloudflare/vitest-pool-workers": "^0.16.13", + "openapi-typescript": "^7.13.0", "vitest": "^4.1.8", "wrangler": "^4.88.0" } diff --git a/cloudflare-worker/src/api-types.ts b/cloudflare-worker/src/api-types.ts new file mode 100644 index 00000000..260d7a0d --- /dev/null +++ b/cloudflare-worker/src/api-types.ts @@ -0,0 +1,1051 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + +export interface paths { + "/v1alpha/festivals/{festival}/bookmarks": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * @description List all drinks the caller has bookmarked at a festival. + * + * Intended for pre-loading "my festival" state on app open. + */ + get: operations["MyFestivalService_ListBookmarks"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1alpha/festivals/{festival}/drinks/{drink}/bookmark": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * @description --- Bookmarks (caller-scoped singletons) --------------------------------- + * Get the caller's bookmark for a drink. + */ + get: operations["MyFestivalService_GetBookmark"]; + put?: never; + post?: never; + /** @description Remove the caller's bookmark for a drink. */ + delete: operations["MyFestivalService_DeleteBookmark"]; + options?: never; + head?: never; + /** @description Create or update the caller's bookmark for a drink (upsert). */ + patch: operations["MyFestivalService_UpdateBookmark"]; + trace?: never; + }; + "/v1alpha/festivals/{festival}/drinks/{drink}/note": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * @description --- Tasting notes (caller-scoped singletons) ----------------------------- + * Get the caller's tasting note for a drink. + */ + get: operations["MyFestivalService_GetNote"]; + put?: never; + post?: never; + /** @description Remove the caller's tasting note for a drink. */ + delete: operations["MyFestivalService_DeleteNote"]; + options?: never; + head?: never; + /** @description Create or update the caller's tasting note for a drink (upsert). */ + patch: operations["MyFestivalService_UpdateNote"]; + trace?: never; + }; + "/v1alpha/festivals/{festival}/drinks/{drink}/review": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * @description --- Personal reviews (caller-scoped singletons) -------------------------- + * Get the caller's review for a drink. + */ + get: operations["MyFestivalService_GetReview"]; + put?: never; + post?: never; + /** @description Remove the caller's review for a drink. */ + delete: operations["MyFestivalService_DeleteReview"]; + options?: never; + head?: never; + /** + * @description Create or update the caller's review for a drink (upsert). + * + * Use `update_mask` to update a single signal (e.g. only `star_rating`) + * without clearing the other. + */ + patch: operations["MyFestivalService_UpdateReview"]; + trace?: never; + }; + "/v1alpha/festivals/{festival}/drinks/{drink}/tasting": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * @description --- Tasting log (caller-scoped singletons) ------------------------------- + * Get the caller's tasting record for a drink. + */ + get: operations["MyFestivalService_GetTasting"]; + put?: never; + post?: never; + /** @description Remove the caller's tasting record for a drink. */ + delete: operations["MyFestivalService_DeleteTasting"]; + options?: never; + head?: never; + /** + * @description Create or update the caller's tasting record for a drink (upsert). + * + * Use `update_mask` with `pours` to increment the pour count without + * affecting other fields. + */ + patch: operations["MyFestivalService_UpdateTasting"]; + trace?: never; + }; + "/v1alpha/festivals/{festival}/notes": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description List all tasting notes the caller has written at a festival. */ + get: operations["MyFestivalService_ListNotes"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1alpha/festivals/{festival}/reviewSummaries": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description List aggregate review signals for every reviewed drink at a festival. */ + get: operations["MyFestivalService_ListReviewSummaries"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1alpha/festivals/{festival}/reviewSummaries/{reviewSummary}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * @description --- Aggregates (public, not caller-scoped) -------------------------------- + * Get the aggregate review signals for a single drink. + */ + get: operations["MyFestivalService_GetReviewSummary"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1alpha/festivals/{festival}/reviews": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * @description List all reviews the caller has left for drinks at a festival. + * + * Only the caller's own reviews are returned; caller identity is implicit in + * the auth context. Intended for pre-loading "my festival" state on app open. + */ + get: operations["MyFestivalService_ListReviews"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1alpha/festivals/{festival}/tastingSummaries": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description List tasting counts for every tried drink at a festival. */ + get: operations["MyFestivalService_ListTastingSummaries"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1alpha/festivals/{festival}/tastingSummaries/{tastingSummary}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description Get tasting counts for a single drink. */ + get: operations["MyFestivalService_GetTastingSummary"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1alpha/festivals/{festival}/tastings": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description List all tasting records the caller has logged at a festival. */ + get: operations["MyFestivalService_ListTastings"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; +} +export type webhooks = Record; +export interface components { + schemas: { + /** + * @description A drink the caller has bookmarked at a festival. + * + * Singleton resource — one per (caller, drink). The resource's mere existence + * means the drink is bookmarked; deleting it removes the bookmark. The caller + * is implicit in the auth context. + */ + Bookmark: { + /** @description Resource name: festivals/{festival}/drinks/{drink}/bookmark. */ + name?: string; + /** + * Format: date-time + * @description When the bookmark was created. + */ + readonly createTime?: string; + }; + /** @description Response message for ListBookmarks. */ + ListBookmarksResponse: { + /** @description The caller's bookmarks for this page, one per bookmarked drink. */ + bookmarks?: components["schemas"]["Bookmark"][]; + /** @description Token for the next page; empty when there are no more results. */ + nextPageToken?: string; + /** + * Format: int32 + * @description Total number of drinks the caller has bookmarked at this festival. + */ + totalSize?: number; + }; + /** @description Response message for ListNotes. */ + ListNotesResponse: { + /** @description The caller's notes for this page, one per noted drink. */ + notes?: components["schemas"]["Note"][]; + /** @description Token for the next page; empty when there are no more results. */ + nextPageToken?: string; + /** + * Format: int32 + * @description Total number of drinks the caller has notes for at this festival. + */ + totalSize?: number; + }; + /** @description Response message for ListReviewSummaries. */ + ListReviewSummariesResponse: { + /** @description Aggregate review signals for this page, one per reviewed drink. */ + reviewSummaries?: components["schemas"]["ReviewSummary"][]; + /** @description Token for the next page; empty when there are no more results. */ + nextPageToken?: string; + /** + * Format: int32 + * @description Total number of drinks with at least one review at this festival. + */ + totalSize?: number; + }; + /** @description Response message for ListReviews. */ + ListReviewsResponse: { + /** @description The caller's reviews for this page, one per reviewed drink. */ + reviews?: components["schemas"]["Review"][]; + /** @description Token for the next page; empty when there are no more results. */ + nextPageToken?: string; + /** + * Format: int32 + * @description Total number of drinks the caller has reviewed at this festival. + */ + totalSize?: number; + }; + /** @description Response message for ListTastingSummaries. */ + ListTastingSummariesResponse: { + /** @description Tasting counts for this page, one per tried drink. */ + tastingSummaries?: components["schemas"]["TastingSummary"][]; + /** @description Token for the next page; empty when there are no more results. */ + nextPageToken?: string; + /** + * Format: int32 + * @description Total number of drinks tried by at least one caller at this festival. + */ + totalSize?: number; + }; + /** @description Response message for ListTastings. */ + ListTastingsResponse: { + /** @description The caller's tasting records for this page, one per tried drink. */ + tastings?: components["schemas"]["Tasting"][]; + /** @description Token for the next page; empty when there are no more results. */ + nextPageToken?: string; + /** + * Format: int32 + * @description Total number of drinks the caller has tried at this festival. + */ + totalSize?: number; + }; + /** + * @description The caller's free-text tasting note for one drink at one festival. + * + * Singleton resource — one per (caller, drink). The caller is implicit in the + * auth context. A note is independent of a Review: you can note without rating, + * or rate without noting. + */ + Note: { + /** @description Resource name: festivals/{festival}/drinks/{drink}/note. */ + name?: string; + /** @description The caller's note text. Max 2000 Unicode characters. */ + content: string; + /** + * Format: date-time + * @description When this note was last written. + */ + readonly updateTime?: string; + }; + /** + * @description The caller's review of one drink at one festival: a star rating (1-5) and/or + * a "would recommend" answer. + * + * Singleton resource — one per (caller, drink). The caller is implicit in the + * auth context; their identity never appears in the resource name, keeping + * device IDs private and making the sign-in upgrade transparent to clients. + * + * Both signals are optional and independent: a caller can rate without + * answering the recommendation question, or vice versa. + */ + Review: { + /** @description Resource name: festivals/{festival}/drinks/{drink}/review. */ + name?: string; + /** + * Format: int32 + * @description Star rating, 1–5 inclusive. Absent if the caller has not set a star rating. + */ + starRating?: number; + /** @description Whether the caller would recommend this drink. Absent if not answered. */ + wouldRecommend?: boolean; + /** + * Format: date-time + * @description When this review was last written. + */ + readonly updateTime?: string; + }; + /** + * @description Computed, read-only aggregate of all callers' reviews for one drink. + * + * Keyed by drink under the festival so the whole festival can be fetched in + * one paginated call for list/grid views. + */ + ReviewSummary: { + /** @description Resource name: festivals/{festival}/reviewSummaries/{drink}. */ + name?: string; + /** + * Format: int32 + * @description Number of callers who have submitted a star rating. + */ + readonly ratingCount?: number; + /** + * Format: double + * @description Mean star rating across all callers (1.0–5.0); 0 when rating_count is 0. + */ + readonly averageRating?: number; + /** + * Format: int32 + * @description Number of callers who have answered the "would recommend" question. + */ + readonly responseCount?: number; + /** + * Format: int32 + * @description Number of callers who answered "yes" to the recommendation question. + */ + readonly recommendCount?: number; + /** + * Format: double + * @description Fraction of responses (0.0–1.0) that would recommend; 0 when + * response_count is 0. + */ + readonly recommendRate?: number; + }; + /** + * @description A record that the caller has tried a drink at a festival. + * + * Singleton resource — one per (caller, drink). The caller is implicit in the + * auth context. `pours` tracks how many times the caller has had this drink at + * the festival (e.g. returned for a second half-pint); absent means one pour. + */ + Tasting: { + /** @description Resource name: festivals/{festival}/drinks/{drink}/tasting. */ + name?: string; + /** + * Format: int32 + * @description How many times the caller has had this drink. Absent means one pour. + * Must be >= 1 when present. + */ + pours?: number; + /** + * Format: date-time + * @description When the caller first tried this drink. + */ + readonly createTime?: string; + /** + * Format: date-time + * @description When this record was last updated. + */ + readonly updateTime?: string; + }; + /** + * @description Computed, read-only aggregate of how many callers have tried a drink. + * + * Useful for social discovery ("N people have tried this"). Keyed by drink + * under the festival, matching the ReviewSummary pattern. + */ + TastingSummary: { + /** @description Resource name: festivals/{festival}/tastingSummaries/{drink}. */ + name?: string; + /** + * Format: int32 + * @description Number of distinct callers who have logged a tasting for this drink. + */ + readonly tasterCount?: number; + /** + * Format: int32 + * @description Total pours logged across all callers. + */ + readonly totalPours?: number; + }; + }; + responses: never; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; +} +export type $defs = Record; +export interface operations { + MyFestivalService_ListBookmarks: { + parameters: { + query?: { + /** + * @description Maximum number of bookmarks to return. The server default returns all of + * the caller's bookmarks for the festival in a single page (festival drink + * counts are bounded). Set explicitly to paginate. + */ + pageSize?: number; + /** @description Page token from a previous ListBookmarks response. */ + pageToken?: string; + }; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ListBookmarksResponse"]; + }; + }; + }; + }; + MyFestivalService_GetBookmark: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + /** @description The drink id. */ + drink: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Bookmark"]; + }; + }; + }; + }; + MyFestivalService_DeleteBookmark: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + /** @description The drink id. */ + drink: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + MyFestivalService_UpdateBookmark: { + parameters: { + query?: { + /** @description Fields to update. Omit to replace all writable fields. */ + updateMask?: string; + }; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + /** @description The drink id. */ + drink: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["Bookmark"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Bookmark"]; + }; + }; + }; + }; + MyFestivalService_GetNote: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + /** @description The drink id. */ + drink: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Note"]; + }; + }; + }; + }; + MyFestivalService_DeleteNote: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + /** @description The drink id. */ + drink: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + MyFestivalService_UpdateNote: { + parameters: { + query?: { + /** @description Fields to update. Omit to replace all writable fields. */ + updateMask?: string; + }; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + /** @description The drink id. */ + drink: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["Note"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Note"]; + }; + }; + }; + }; + MyFestivalService_GetReview: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + /** @description The drink id. */ + drink: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Review"]; + }; + }; + }; + }; + MyFestivalService_DeleteReview: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + /** @description The drink id. */ + drink: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + MyFestivalService_UpdateReview: { + parameters: { + query?: { + /** + * @description Fields to update. Omit to replace all writable fields. Specify + * `star_rating` or `would_recommend` individually to update one signal + * without affecting the other. + */ + updateMask?: string; + }; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + /** @description The drink id. */ + drink: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["Review"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Review"]; + }; + }; + }; + }; + MyFestivalService_GetTasting: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + /** @description The drink id. */ + drink: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Tasting"]; + }; + }; + }; + }; + MyFestivalService_DeleteTasting: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + /** @description The drink id. */ + drink: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + MyFestivalService_UpdateTasting: { + parameters: { + query?: { + /** + * @description Fields to update. Omit to replace all writable fields. Specify `pours` + * to update the pour count without affecting other fields. + */ + updateMask?: string; + }; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + /** @description The drink id. */ + drink: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["Tasting"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Tasting"]; + }; + }; + }; + }; + MyFestivalService_ListNotes: { + parameters: { + query?: { + /** + * @description Maximum number of notes to return. The server default returns all of the + * caller's notes for the festival in a single page (festival drink counts + * are bounded). Set explicitly to paginate. + */ + pageSize?: number; + /** @description Page token from a previous ListNotes response. */ + pageToken?: string; + }; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ListNotesResponse"]; + }; + }; + }; + }; + MyFestivalService_ListReviewSummaries: { + parameters: { + query?: { + /** + * @description Maximum number of summaries to return. The server default returns all + * summaries for the festival in a single page (drink counts are bounded). + * Set explicitly to paginate. + */ + pageSize?: number; + /** @description Page token from a previous ListReviewSummaries response. */ + pageToken?: string; + }; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ListReviewSummariesResponse"]; + }; + }; + }; + }; + MyFestivalService_GetReviewSummary: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + /** @description The reviewSummary id. */ + reviewSummary: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ReviewSummary"]; + }; + }; + }; + }; + MyFestivalService_ListReviews: { + parameters: { + query?: { + /** + * @description Maximum number of reviews to return. The server default returns all of the + * caller's reviews for the festival in a single page (festival drink counts + * are bounded). Set explicitly to paginate. + */ + pageSize?: number; + /** @description Page token from a previous ListReviews response. */ + pageToken?: string; + }; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ListReviewsResponse"]; + }; + }; + }; + }; + MyFestivalService_ListTastingSummaries: { + parameters: { + query?: { + /** + * @description Maximum number of summaries to return. The server default returns all + * summaries for the festival in a single page (drink counts are bounded). + * Set explicitly to paginate. + */ + pageSize?: number; + /** @description Page token from a previous ListTastingSummaries response. */ + pageToken?: string; + }; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ListTastingSummariesResponse"]; + }; + }; + }; + }; + MyFestivalService_GetTastingSummary: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + /** @description The tastingSummary id. */ + tastingSummary: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["TastingSummary"]; + }; + }; + }; + }; + MyFestivalService_ListTastings: { + parameters: { + query?: { + /** + * @description Maximum number of tastings to return. The server default returns all of + * the caller's tastings for the festival in a single page (festival drink + * counts are bounded). Set explicitly to paginate. + */ + pageSize?: number; + /** @description Page token from a previous ListTastings response. */ + pageToken?: string; + }; + header?: never; + path: { + /** @description The festival id. */ + festival: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ListTastingsResponse"]; + }; + }; + }; + }; +} diff --git a/docs/code/api/openapi/openapi.yaml b/docs/code/api/openapi/openapi.yaml new file mode 100644 index 00000000..f6fafaee --- /dev/null +++ b/docs/code/api/openapi/openapi.yaml @@ -0,0 +1,899 @@ +# Generated with protoc-gen-openapi +# https://github.com/google/gnostic/tree/master/cmd/protoc-gen-openapi + +openapi: 3.0.3 +info: + title: MyFestivalService API + description: |- + Stores each caller's personal festival state (bookmarks, notes, tastings, + reviews) and serves back bucket-scoped aggregates. Writes are local-first on + the client; this service holds the shared, cross-device state. + + All personal resources are singleton resources — one per (caller, drink). + The caller's identity is resolved from the auth context; it never appears in + resource names, keeping device IDs private and making the sign-in upgrade + transparent to existing clients. + version: 0.0.1 +servers: + - url: https://api.cambeerfestival.app +paths: + /v1alpha/festivals/{festival}/bookmarks: + get: + tags: + - MyFestivalService + description: |- + List all drinks the caller has bookmarked at a festival. + + Intended for pre-loading "my festival" state on app open. + operationId: MyFestivalService_ListBookmarks + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: pageSize + in: query + description: |- + Maximum number of bookmarks to return. The server default returns all of + the caller's bookmarks for the festival in a single page (festival drink + counts are bounded). Set explicitly to paginate. + schema: + type: integer + format: int32 + - name: pageToken + in: query + description: Page token from a previous ListBookmarks response. + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListBookmarksResponse' + /v1alpha/festivals/{festival}/drinks/{drink}/bookmark: + get: + tags: + - MyFestivalService + description: |- + --- Bookmarks (caller-scoped singletons) --------------------------------- + Get the caller's bookmark for a drink. + operationId: MyFestivalService_GetBookmark + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: drink + in: path + description: The drink id. + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Bookmark' + delete: + tags: + - MyFestivalService + description: Remove the caller's bookmark for a drink. + operationId: MyFestivalService_DeleteBookmark + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: drink + in: path + description: The drink id. + required: true + schema: + type: string + responses: + "200": + description: OK + content: {} + patch: + tags: + - MyFestivalService + description: Create or update the caller's bookmark for a drink (upsert). + operationId: MyFestivalService_UpdateBookmark + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: drink + in: path + description: The drink id. + required: true + schema: + type: string + - name: updateMask + in: query + description: Fields to update. Omit to replace all writable fields. + schema: + type: string + format: field-mask + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Bookmark' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Bookmark' + /v1alpha/festivals/{festival}/drinks/{drink}/note: + get: + tags: + - MyFestivalService + description: |- + --- Tasting notes (caller-scoped singletons) ----------------------------- + Get the caller's tasting note for a drink. + operationId: MyFestivalService_GetNote + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: drink + in: path + description: The drink id. + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Note' + delete: + tags: + - MyFestivalService + description: Remove the caller's tasting note for a drink. + operationId: MyFestivalService_DeleteNote + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: drink + in: path + description: The drink id. + required: true + schema: + type: string + responses: + "200": + description: OK + content: {} + patch: + tags: + - MyFestivalService + description: Create or update the caller's tasting note for a drink (upsert). + operationId: MyFestivalService_UpdateNote + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: drink + in: path + description: The drink id. + required: true + schema: + type: string + - name: updateMask + in: query + description: Fields to update. Omit to replace all writable fields. + schema: + type: string + format: field-mask + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Note' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Note' + /v1alpha/festivals/{festival}/drinks/{drink}/review: + get: + tags: + - MyFestivalService + description: |- + --- Personal reviews (caller-scoped singletons) -------------------------- + Get the caller's review for a drink. + operationId: MyFestivalService_GetReview + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: drink + in: path + description: The drink id. + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Review' + delete: + tags: + - MyFestivalService + description: Remove the caller's review for a drink. + operationId: MyFestivalService_DeleteReview + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: drink + in: path + description: The drink id. + required: true + schema: + type: string + responses: + "200": + description: OK + content: {} + patch: + tags: + - MyFestivalService + description: |- + Create or update the caller's review for a drink (upsert). + + Use `update_mask` to update a single signal (e.g. only `star_rating`) + without clearing the other. + operationId: MyFestivalService_UpdateReview + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: drink + in: path + description: The drink id. + required: true + schema: + type: string + - name: updateMask + in: query + description: |- + Fields to update. Omit to replace all writable fields. Specify + `star_rating` or `would_recommend` individually to update one signal + without affecting the other. + schema: + type: string + format: field-mask + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Review' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Review' + /v1alpha/festivals/{festival}/drinks/{drink}/tasting: + get: + tags: + - MyFestivalService + description: |- + --- Tasting log (caller-scoped singletons) ------------------------------- + Get the caller's tasting record for a drink. + operationId: MyFestivalService_GetTasting + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: drink + in: path + description: The drink id. + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Tasting' + delete: + tags: + - MyFestivalService + description: Remove the caller's tasting record for a drink. + operationId: MyFestivalService_DeleteTasting + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: drink + in: path + description: The drink id. + required: true + schema: + type: string + responses: + "200": + description: OK + content: {} + patch: + tags: + - MyFestivalService + description: |- + Create or update the caller's tasting record for a drink (upsert). + + Use `update_mask` with `pours` to increment the pour count without + affecting other fields. + operationId: MyFestivalService_UpdateTasting + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: drink + in: path + description: The drink id. + required: true + schema: + type: string + - name: updateMask + in: query + description: |- + Fields to update. Omit to replace all writable fields. Specify `pours` + to update the pour count without affecting other fields. + schema: + type: string + format: field-mask + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tasting' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Tasting' + /v1alpha/festivals/{festival}/notes: + get: + tags: + - MyFestivalService + description: List all tasting notes the caller has written at a festival. + operationId: MyFestivalService_ListNotes + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: pageSize + in: query + description: |- + Maximum number of notes to return. The server default returns all of the + caller's notes for the festival in a single page (festival drink counts + are bounded). Set explicitly to paginate. + schema: + type: integer + format: int32 + - name: pageToken + in: query + description: Page token from a previous ListNotes response. + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListNotesResponse' + /v1alpha/festivals/{festival}/reviewSummaries: + get: + tags: + - MyFestivalService + description: List aggregate review signals for every reviewed drink at a festival. + operationId: MyFestivalService_ListReviewSummaries + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: pageSize + in: query + description: |- + Maximum number of summaries to return. The server default returns all + summaries for the festival in a single page (drink counts are bounded). + Set explicitly to paginate. + schema: + type: integer + format: int32 + - name: pageToken + in: query + description: Page token from a previous ListReviewSummaries response. + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListReviewSummariesResponse' + /v1alpha/festivals/{festival}/reviewSummaries/{reviewSummary}: + get: + tags: + - MyFestivalService + description: |- + --- Aggregates (public, not caller-scoped) -------------------------------- + Get the aggregate review signals for a single drink. + operationId: MyFestivalService_GetReviewSummary + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: reviewSummary + in: path + description: The reviewSummary id. + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ReviewSummary' + /v1alpha/festivals/{festival}/reviews: + get: + tags: + - MyFestivalService + description: |- + List all reviews the caller has left for drinks at a festival. + + Only the caller's own reviews are returned; caller identity is implicit in + the auth context. Intended for pre-loading "my festival" state on app open. + operationId: MyFestivalService_ListReviews + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: pageSize + in: query + description: |- + Maximum number of reviews to return. The server default returns all of the + caller's reviews for the festival in a single page (festival drink counts + are bounded). Set explicitly to paginate. + schema: + type: integer + format: int32 + - name: pageToken + in: query + description: Page token from a previous ListReviews response. + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListReviewsResponse' + /v1alpha/festivals/{festival}/tastingSummaries: + get: + tags: + - MyFestivalService + description: List tasting counts for every tried drink at a festival. + operationId: MyFestivalService_ListTastingSummaries + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: pageSize + in: query + description: |- + Maximum number of summaries to return. The server default returns all + summaries for the festival in a single page (drink counts are bounded). + Set explicitly to paginate. + schema: + type: integer + format: int32 + - name: pageToken + in: query + description: Page token from a previous ListTastingSummaries response. + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListTastingSummariesResponse' + /v1alpha/festivals/{festival}/tastingSummaries/{tastingSummary}: + get: + tags: + - MyFestivalService + description: Get tasting counts for a single drink. + operationId: MyFestivalService_GetTastingSummary + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: tastingSummary + in: path + description: The tastingSummary id. + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/TastingSummary' + /v1alpha/festivals/{festival}/tastings: + get: + tags: + - MyFestivalService + description: List all tasting records the caller has logged at a festival. + operationId: MyFestivalService_ListTastings + parameters: + - name: festival + in: path + description: The festival id. + required: true + schema: + type: string + - name: pageSize + in: query + description: |- + Maximum number of tastings to return. The server default returns all of + the caller's tastings for the festival in a single page (festival drink + counts are bounded). Set explicitly to paginate. + schema: + type: integer + format: int32 + - name: pageToken + in: query + description: Page token from a previous ListTastings response. + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListTastingsResponse' +components: + schemas: + Bookmark: + type: object + properties: + name: + type: string + description: 'Resource name: festivals/{festival}/drinks/{drink}/bookmark.' + createTime: + readOnly: true + type: string + description: When the bookmark was created. + format: date-time + description: |- + A drink the caller has bookmarked at a festival. + + Singleton resource — one per (caller, drink). The resource's mere existence + means the drink is bookmarked; deleting it removes the bookmark. The caller + is implicit in the auth context. + ListBookmarksResponse: + type: object + properties: + bookmarks: + type: array + items: + $ref: '#/components/schemas/Bookmark' + description: The caller's bookmarks for this page, one per bookmarked drink. + nextPageToken: + type: string + description: Token for the next page; empty when there are no more results. + totalSize: + type: integer + description: Total number of drinks the caller has bookmarked at this festival. + format: int32 + description: Response message for ListBookmarks. + ListNotesResponse: + type: object + properties: + notes: + type: array + items: + $ref: '#/components/schemas/Note' + description: The caller's notes for this page, one per noted drink. + nextPageToken: + type: string + description: Token for the next page; empty when there are no more results. + totalSize: + type: integer + description: Total number of drinks the caller has notes for at this festival. + format: int32 + description: Response message for ListNotes. + ListReviewSummariesResponse: + type: object + properties: + reviewSummaries: + type: array + items: + $ref: '#/components/schemas/ReviewSummary' + description: Aggregate review signals for this page, one per reviewed drink. + nextPageToken: + type: string + description: Token for the next page; empty when there are no more results. + totalSize: + type: integer + description: Total number of drinks with at least one review at this festival. + format: int32 + description: Response message for ListReviewSummaries. + ListReviewsResponse: + type: object + properties: + reviews: + type: array + items: + $ref: '#/components/schemas/Review' + description: The caller's reviews for this page, one per reviewed drink. + nextPageToken: + type: string + description: Token for the next page; empty when there are no more results. + totalSize: + type: integer + description: Total number of drinks the caller has reviewed at this festival. + format: int32 + description: Response message for ListReviews. + ListTastingSummariesResponse: + type: object + properties: + tastingSummaries: + type: array + items: + $ref: '#/components/schemas/TastingSummary' + description: Tasting counts for this page, one per tried drink. + nextPageToken: + type: string + description: Token for the next page; empty when there are no more results. + totalSize: + type: integer + description: Total number of drinks tried by at least one caller at this festival. + format: int32 + description: Response message for ListTastingSummaries. + ListTastingsResponse: + type: object + properties: + tastings: + type: array + items: + $ref: '#/components/schemas/Tasting' + description: The caller's tasting records for this page, one per tried drink. + nextPageToken: + type: string + description: Token for the next page; empty when there are no more results. + totalSize: + type: integer + description: Total number of drinks the caller has tried at this festival. + format: int32 + description: Response message for ListTastings. + Note: + required: + - content + type: object + properties: + name: + type: string + description: 'Resource name: festivals/{festival}/drinks/{drink}/note.' + content: + type: string + description: The caller's note text. Max 2000 Unicode characters. + updateTime: + readOnly: true + type: string + description: When this note was last written. + format: date-time + description: |- + The caller's free-text tasting note for one drink at one festival. + + Singleton resource — one per (caller, drink). The caller is implicit in the + auth context. A note is independent of a Review: you can note without rating, + or rate without noting. + Review: + type: object + properties: + name: + type: string + description: 'Resource name: festivals/{festival}/drinks/{drink}/review.' + starRating: + type: integer + description: Star rating, 1–5 inclusive. Absent if the caller has not set a star rating. + format: int32 + wouldRecommend: + type: boolean + description: Whether the caller would recommend this drink. Absent if not answered. + updateTime: + readOnly: true + type: string + description: When this review was last written. + format: date-time + description: |- + The caller's review of one drink at one festival: a star rating (1-5) and/or + a "would recommend" answer. + + Singleton resource — one per (caller, drink). The caller is implicit in the + auth context; their identity never appears in the resource name, keeping + device IDs private and making the sign-in upgrade transparent to clients. + + Both signals are optional and independent: a caller can rate without + answering the recommendation question, or vice versa. + ReviewSummary: + type: object + properties: + name: + type: string + description: 'Resource name: festivals/{festival}/reviewSummaries/{drink}.' + ratingCount: + readOnly: true + type: integer + description: Number of callers who have submitted a star rating. + format: int32 + averageRating: + readOnly: true + type: number + description: Mean star rating across all callers (1.0–5.0); 0 when rating_count is 0. + format: double + responseCount: + readOnly: true + type: integer + description: Number of callers who have answered the "would recommend" question. + format: int32 + recommendCount: + readOnly: true + type: integer + description: Number of callers who answered "yes" to the recommendation question. + format: int32 + recommendRate: + readOnly: true + type: number + description: |- + Fraction of responses (0.0–1.0) that would recommend; 0 when + response_count is 0. + format: double + description: |- + Computed, read-only aggregate of all callers' reviews for one drink. + + Keyed by drink under the festival so the whole festival can be fetched in + one paginated call for list/grid views. + Tasting: + type: object + properties: + name: + type: string + description: 'Resource name: festivals/{festival}/drinks/{drink}/tasting.' + pours: + type: integer + description: |- + How many times the caller has had this drink. Absent means one pour. + Must be >= 1 when present. + format: int32 + createTime: + readOnly: true + type: string + description: When the caller first tried this drink. + format: date-time + updateTime: + readOnly: true + type: string + description: When this record was last updated. + format: date-time + description: |- + A record that the caller has tried a drink at a festival. + + Singleton resource — one per (caller, drink). The caller is implicit in the + auth context. `pours` tracks how many times the caller has had this drink at + the festival (e.g. returned for a second half-pint); absent means one pour. + TastingSummary: + type: object + properties: + name: + type: string + description: 'Resource name: festivals/{festival}/tastingSummaries/{drink}.' + tasterCount: + readOnly: true + type: integer + description: Number of distinct callers who have logged a tasting for this drink. + format: int32 + totalPours: + readOnly: true + type: integer + description: Total pours logged across all callers. + format: int32 + description: |- + Computed, read-only aggregate of how many callers have tried a drink. + + Useful for social discovery ("N people have tried this"). Keyed by drink + under the festival, matching the ReviewSummary pattern. +tags: + - name: MyFestivalService diff --git a/mise.dev.toml b/mise.dev.toml index 0b5f9240..a3cded91 100644 --- a/mise.dev.toml +++ b/mise.dev.toml @@ -46,6 +46,39 @@ description = "Generate OpenAPI from the proto contract (BSR remote plugin)" dir = "proto" run = "buf generate" +[tasks."proto:clients"] +description = "Generate Worker TS types and Flutter Dart client from OpenAPI spec" +depends = ["proto:clients:types", "proto:clients:dart"] + +[tasks."proto:clients:types"] +description = "Generate TypeScript types for the Cloudflare Worker from OpenAPI" +run = """ +npx --prefix cloudflare-worker openapi-typescript \ + docs/code/api/openapi/openapi.yaml \ + -o cloudflare-worker/src/api-types.ts +""" + +[tasks."proto:clients:dart"] +description = "Generate Dart/Dio client for Flutter from OpenAPI (requires Java)" +env = { OPENAPI_GENERATOR_JAR = "${HOME}/.cache/openapi-generator/openapi-generator-cli-7.13.0.jar" } +run = """ +mkdir -p "${HOME}/.cache/openapi-generator" +if [ ! -f "${OPENAPI_GENERATOR_JAR}" ]; then + echo "Downloading openapi-generator-cli 7.13.0..." + curl -sSfL \ + "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.13.0/openapi-generator-cli-7.13.0.jar" \ + -o "${OPENAPI_GENERATOR_JAR}" +fi +java -jar "${OPENAPI_GENERATOR_JAR}" generate \ + --input-spec docs/code/api/openapi/openapi.yaml \ + --generator-name dart-dio \ + --output packages/myfestival_client \ + --additional-properties=pubName=myfestival_client,pubAuthor=Cambridge Beer Festival,browserClient=false,nullSafe=true,dateLibrary=core +cd packages/myfestival_client +dart pub get +dart run build_runner build +""" + [tasks."proto:api-lint"] description = "Lint proto files against Google AIP design guidelines (googleapis/api-linter)" dir = "proto" diff --git a/packages/myfestival_client/.gitignore b/packages/myfestival_client/.gitignore new file mode 100644 index 00000000..4298cdcb --- /dev/null +++ b/packages/myfestival_client/.gitignore @@ -0,0 +1,41 @@ +# See https://dart.dev/guides/libraries/private-files + +# Files and directories created by pub +.dart_tool/ +.buildlog +.packages +.project +.pub/ +build/ +**/packages/ + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) +*.dart.js +*.part.js +*.js.deps +*.js.map +*.info.json + +# Directory created by dartdoc +doc/api/ + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +pubspec.lock + +# Don’t commit files and directories created by other development environments. +# For example, if your development environment creates any of the following files, +# consider putting them in a global ignore file: + +# IntelliJ +*.iml +*.ipr +*.iws +.idea/ + +# Mac +.DS_Store diff --git a/packages/myfestival_client/.openapi-generator-ignore b/packages/myfestival_client/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/packages/myfestival_client/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/packages/myfestival_client/.openapi-generator/FILES b/packages/myfestival_client/.openapi-generator/FILES new file mode 100644 index 00000000..008d7281 --- /dev/null +++ b/packages/myfestival_client/.openapi-generator/FILES @@ -0,0 +1,55 @@ +.gitignore +.openapi-generator-ignore +README.md +analysis_options.yaml +doc/Bookmark.md +doc/ListBookmarksResponse.md +doc/ListNotesResponse.md +doc/ListReviewSummariesResponse.md +doc/ListReviewsResponse.md +doc/ListTastingSummariesResponse.md +doc/ListTastingsResponse.md +doc/MyFestivalServiceApi.md +doc/Note.md +doc/Review.md +doc/ReviewSummary.md +doc/Tasting.md +doc/TastingSummary.md +lib/myfestival_client.dart +lib/src/api.dart +lib/src/api/my_festival_service_api.dart +lib/src/api_util.dart +lib/src/auth/api_key_auth.dart +lib/src/auth/auth.dart +lib/src/auth/basic_auth.dart +lib/src/auth/bearer_auth.dart +lib/src/auth/oauth.dart +lib/src/date_serializer.dart +lib/src/model/bookmark.dart +lib/src/model/date.dart +lib/src/model/list_bookmarks_response.dart +lib/src/model/list_notes_response.dart +lib/src/model/list_review_summaries_response.dart +lib/src/model/list_reviews_response.dart +lib/src/model/list_tasting_summaries_response.dart +lib/src/model/list_tastings_response.dart +lib/src/model/note.dart +lib/src/model/review.dart +lib/src/model/review_summary.dart +lib/src/model/tasting.dart +lib/src/model/tasting_summary.dart +lib/src/serializers.dart +pubspec.yaml +test/bookmark_test.dart +test/list_bookmarks_response_test.dart +test/list_notes_response_test.dart +test/list_review_summaries_response_test.dart +test/list_reviews_response_test.dart +test/list_tasting_summaries_response_test.dart +test/list_tastings_response_test.dart +test/my_festival_service_api_test.dart +test/note_test.dart +test/review_summary_test.dart +test/review_test.dart +test/tasting_summary_test.dart +test/tasting_test.dart diff --git a/packages/myfestival_client/.openapi-generator/VERSION b/packages/myfestival_client/.openapi-generator/VERSION new file mode 100644 index 00000000..eb1dc6a5 --- /dev/null +++ b/packages/myfestival_client/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.13.0 diff --git a/packages/myfestival_client/README.md b/packages/myfestival_client/README.md new file mode 100644 index 00000000..c11dc925 --- /dev/null +++ b/packages/myfestival_client/README.md @@ -0,0 +1,121 @@ +# myfestival_client (EXPERIMENTAL) +Stores each caller's personal festival state (bookmarks, notes, tastings, + reviews) and serves back bucket-scoped aggregates. Writes are local-first on + the client; this service holds the shared, cross-device state. + + All personal resources are singleton resources — one per (caller, drink). + The caller's identity is resolved from the auth context; it never appears in + resource names, keeping device IDs private and making the sign-in upgrade + transparent to existing clients. + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 0.0.1 +- Generator version: 7.13.0 +- Build package: org.openapitools.codegen.languages.DartDioClientCodegen + +## Requirements + +* Dart 2.15.0+ or Flutter 2.8.0+ +* Dio 5.0.0+ (https://pub.dev/packages/dio) + +## Installation & Usage + +### pub.dev +To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml +```yaml +dependencies: + myfestival_client: 1.0.0 +``` + +### Github +If this Dart package is published to Github, please include the following in pubspec.yaml +```yaml +dependencies: + myfestival_client: + git: + url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git + #ref: main +``` + +### Local development +To use the package from your local drive, please include the following in pubspec.yaml +```yaml +dependencies: + myfestival_client: + path: /path/to/myfestival_client +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```dart +import 'package:myfestival_client/myfestival_client.dart'; + + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final String drink = drink_example; // String | The drink id. + +try { + api.myFestivalServiceDeleteBookmark(festival, drink); +} catch on DioException (e) { + print("Exception when calling MyFestivalServiceApi->myFestivalServiceDeleteBookmark: $e\n"); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.cambeerfestival.app* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceDeleteBookmark**](doc/MyFestivalServiceApi.md#myfestivalservicedeletebookmark) | **DELETE** /v1alpha/festivals/{festival}/drinks/{drink}/bookmark | +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceDeleteNote**](doc/MyFestivalServiceApi.md#myfestivalservicedeletenote) | **DELETE** /v1alpha/festivals/{festival}/drinks/{drink}/note | +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceDeleteReview**](doc/MyFestivalServiceApi.md#myfestivalservicedeletereview) | **DELETE** /v1alpha/festivals/{festival}/drinks/{drink}/review | +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceDeleteTasting**](doc/MyFestivalServiceApi.md#myfestivalservicedeletetasting) | **DELETE** /v1alpha/festivals/{festival}/drinks/{drink}/tasting | +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceGetBookmark**](doc/MyFestivalServiceApi.md#myfestivalservicegetbookmark) | **GET** /v1alpha/festivals/{festival}/drinks/{drink}/bookmark | +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceGetNote**](doc/MyFestivalServiceApi.md#myfestivalservicegetnote) | **GET** /v1alpha/festivals/{festival}/drinks/{drink}/note | +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceGetReview**](doc/MyFestivalServiceApi.md#myfestivalservicegetreview) | **GET** /v1alpha/festivals/{festival}/drinks/{drink}/review | +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceGetReviewSummary**](doc/MyFestivalServiceApi.md#myfestivalservicegetreviewsummary) | **GET** /v1alpha/festivals/{festival}/reviewSummaries/{reviewSummary} | +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceGetTasting**](doc/MyFestivalServiceApi.md#myfestivalservicegettasting) | **GET** /v1alpha/festivals/{festival}/drinks/{drink}/tasting | +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceGetTastingSummary**](doc/MyFestivalServiceApi.md#myfestivalservicegettastingsummary) | **GET** /v1alpha/festivals/{festival}/tastingSummaries/{tastingSummary} | +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceListBookmarks**](doc/MyFestivalServiceApi.md#myfestivalservicelistbookmarks) | **GET** /v1alpha/festivals/{festival}/bookmarks | +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceListNotes**](doc/MyFestivalServiceApi.md#myfestivalservicelistnotes) | **GET** /v1alpha/festivals/{festival}/notes | +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceListReviewSummaries**](doc/MyFestivalServiceApi.md#myfestivalservicelistreviewsummaries) | **GET** /v1alpha/festivals/{festival}/reviewSummaries | +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceListReviews**](doc/MyFestivalServiceApi.md#myfestivalservicelistreviews) | **GET** /v1alpha/festivals/{festival}/reviews | +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceListTastingSummaries**](doc/MyFestivalServiceApi.md#myfestivalservicelisttastingsummaries) | **GET** /v1alpha/festivals/{festival}/tastingSummaries | +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceListTastings**](doc/MyFestivalServiceApi.md#myfestivalservicelisttastings) | **GET** /v1alpha/festivals/{festival}/tastings | +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceUpdateBookmark**](doc/MyFestivalServiceApi.md#myfestivalserviceupdatebookmark) | **PATCH** /v1alpha/festivals/{festival}/drinks/{drink}/bookmark | +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceUpdateNote**](doc/MyFestivalServiceApi.md#myfestivalserviceupdatenote) | **PATCH** /v1alpha/festivals/{festival}/drinks/{drink}/note | +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceUpdateReview**](doc/MyFestivalServiceApi.md#myfestivalserviceupdatereview) | **PATCH** /v1alpha/festivals/{festival}/drinks/{drink}/review | +[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceUpdateTasting**](doc/MyFestivalServiceApi.md#myfestivalserviceupdatetasting) | **PATCH** /v1alpha/festivals/{festival}/drinks/{drink}/tasting | + + +## Documentation For Models + + - [Bookmark](doc/Bookmark.md) + - [ListBookmarksResponse](doc/ListBookmarksResponse.md) + - [ListNotesResponse](doc/ListNotesResponse.md) + - [ListReviewSummariesResponse](doc/ListReviewSummariesResponse.md) + - [ListReviewsResponse](doc/ListReviewsResponse.md) + - [ListTastingSummariesResponse](doc/ListTastingSummariesResponse.md) + - [ListTastingsResponse](doc/ListTastingsResponse.md) + - [Note](doc/Note.md) + - [Review](doc/Review.md) + - [ReviewSummary](doc/ReviewSummary.md) + - [Tasting](doc/Tasting.md) + - [TastingSummary](doc/TastingSummary.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Author + + + diff --git a/packages/myfestival_client/analysis_options.yaml b/packages/myfestival_client/analysis_options.yaml new file mode 100644 index 00000000..16a95850 --- /dev/null +++ b/packages/myfestival_client/analysis_options.yaml @@ -0,0 +1,9 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strict-casts: false + exclude: + - test/*.dart + errors: + deprecated_member_use_from_same_package: ignore diff --git a/packages/myfestival_client/doc/Bookmark.md b/packages/myfestival_client/doc/Bookmark.md new file mode 100644 index 00000000..884886c6 --- /dev/null +++ b/packages/myfestival_client/doc/Bookmark.md @@ -0,0 +1,16 @@ +# myfestival_client.model.Bookmark + +## Load the model package +```dart +import 'package:myfestival_client/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Resource name: festivals/{festival}/drinks/{drink}/bookmark. | [optional] +**createTime** | [**DateTime**](DateTime.md) | When the bookmark was created. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/myfestival_client/doc/ListBookmarksResponse.md b/packages/myfestival_client/doc/ListBookmarksResponse.md new file mode 100644 index 00000000..c53f0766 --- /dev/null +++ b/packages/myfestival_client/doc/ListBookmarksResponse.md @@ -0,0 +1,17 @@ +# myfestival_client.model.ListBookmarksResponse + +## Load the model package +```dart +import 'package:myfestival_client/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bookmarks** | [**BuiltList<Bookmark>**](Bookmark.md) | The caller's bookmarks for this page, one per bookmarked drink. | [optional] +**nextPageToken** | **String** | Token for the next page; empty when there are no more results. | [optional] +**totalSize** | **int** | Total number of drinks the caller has bookmarked at this festival. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/myfestival_client/doc/ListNotesResponse.md b/packages/myfestival_client/doc/ListNotesResponse.md new file mode 100644 index 00000000..d7150d63 --- /dev/null +++ b/packages/myfestival_client/doc/ListNotesResponse.md @@ -0,0 +1,17 @@ +# myfestival_client.model.ListNotesResponse + +## Load the model package +```dart +import 'package:myfestival_client/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**notes** | [**BuiltList<Note>**](Note.md) | The caller's notes for this page, one per noted drink. | [optional] +**nextPageToken** | **String** | Token for the next page; empty when there are no more results. | [optional] +**totalSize** | **int** | Total number of drinks the caller has notes for at this festival. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/myfestival_client/doc/ListReviewSummariesResponse.md b/packages/myfestival_client/doc/ListReviewSummariesResponse.md new file mode 100644 index 00000000..c97593c5 --- /dev/null +++ b/packages/myfestival_client/doc/ListReviewSummariesResponse.md @@ -0,0 +1,17 @@ +# myfestival_client.model.ListReviewSummariesResponse + +## Load the model package +```dart +import 'package:myfestival_client/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reviewSummaries** | [**BuiltList<ReviewSummary>**](ReviewSummary.md) | Aggregate review signals for this page, one per reviewed drink. | [optional] +**nextPageToken** | **String** | Token for the next page; empty when there are no more results. | [optional] +**totalSize** | **int** | Total number of drinks with at least one review at this festival. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/myfestival_client/doc/ListReviewsResponse.md b/packages/myfestival_client/doc/ListReviewsResponse.md new file mode 100644 index 00000000..96dfb3c2 --- /dev/null +++ b/packages/myfestival_client/doc/ListReviewsResponse.md @@ -0,0 +1,17 @@ +# myfestival_client.model.ListReviewsResponse + +## Load the model package +```dart +import 'package:myfestival_client/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reviews** | [**BuiltList<Review>**](Review.md) | The caller's reviews for this page, one per reviewed drink. | [optional] +**nextPageToken** | **String** | Token for the next page; empty when there are no more results. | [optional] +**totalSize** | **int** | Total number of drinks the caller has reviewed at this festival. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/myfestival_client/doc/ListTastingSummariesResponse.md b/packages/myfestival_client/doc/ListTastingSummariesResponse.md new file mode 100644 index 00000000..69b2ffc7 --- /dev/null +++ b/packages/myfestival_client/doc/ListTastingSummariesResponse.md @@ -0,0 +1,17 @@ +# myfestival_client.model.ListTastingSummariesResponse + +## Load the model package +```dart +import 'package:myfestival_client/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tastingSummaries** | [**BuiltList<TastingSummary>**](TastingSummary.md) | Tasting counts for this page, one per tried drink. | [optional] +**nextPageToken** | **String** | Token for the next page; empty when there are no more results. | [optional] +**totalSize** | **int** | Total number of drinks tried by at least one caller at this festival. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/myfestival_client/doc/ListTastingsResponse.md b/packages/myfestival_client/doc/ListTastingsResponse.md new file mode 100644 index 00000000..6a78d985 --- /dev/null +++ b/packages/myfestival_client/doc/ListTastingsResponse.md @@ -0,0 +1,17 @@ +# myfestival_client.model.ListTastingsResponse + +## Load the model package +```dart +import 'package:myfestival_client/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tastings** | [**BuiltList<Tasting>**](Tasting.md) | The caller's tasting records for this page, one per tried drink. | [optional] +**nextPageToken** | **String** | Token for the next page; empty when there are no more results. | [optional] +**totalSize** | **int** | Total number of drinks the caller has tried at this festival. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/myfestival_client/doc/MyFestivalServiceApi.md b/packages/myfestival_client/doc/MyFestivalServiceApi.md new file mode 100644 index 00000000..0a57ac56 --- /dev/null +++ b/packages/myfestival_client/doc/MyFestivalServiceApi.md @@ -0,0 +1,957 @@ +# myfestival_client.api.MyFestivalServiceApi + +## Load the API package +```dart +import 'package:myfestival_client/api.dart'; +``` + +All URIs are relative to *https://api.cambeerfestival.app* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**myFestivalServiceDeleteBookmark**](MyFestivalServiceApi.md#myfestivalservicedeletebookmark) | **DELETE** /v1alpha/festivals/{festival}/drinks/{drink}/bookmark | +[**myFestivalServiceDeleteNote**](MyFestivalServiceApi.md#myfestivalservicedeletenote) | **DELETE** /v1alpha/festivals/{festival}/drinks/{drink}/note | +[**myFestivalServiceDeleteReview**](MyFestivalServiceApi.md#myfestivalservicedeletereview) | **DELETE** /v1alpha/festivals/{festival}/drinks/{drink}/review | +[**myFestivalServiceDeleteTasting**](MyFestivalServiceApi.md#myfestivalservicedeletetasting) | **DELETE** /v1alpha/festivals/{festival}/drinks/{drink}/tasting | +[**myFestivalServiceGetBookmark**](MyFestivalServiceApi.md#myfestivalservicegetbookmark) | **GET** /v1alpha/festivals/{festival}/drinks/{drink}/bookmark | +[**myFestivalServiceGetNote**](MyFestivalServiceApi.md#myfestivalservicegetnote) | **GET** /v1alpha/festivals/{festival}/drinks/{drink}/note | +[**myFestivalServiceGetReview**](MyFestivalServiceApi.md#myfestivalservicegetreview) | **GET** /v1alpha/festivals/{festival}/drinks/{drink}/review | +[**myFestivalServiceGetReviewSummary**](MyFestivalServiceApi.md#myfestivalservicegetreviewsummary) | **GET** /v1alpha/festivals/{festival}/reviewSummaries/{reviewSummary} | +[**myFestivalServiceGetTasting**](MyFestivalServiceApi.md#myfestivalservicegettasting) | **GET** /v1alpha/festivals/{festival}/drinks/{drink}/tasting | +[**myFestivalServiceGetTastingSummary**](MyFestivalServiceApi.md#myfestivalservicegettastingsummary) | **GET** /v1alpha/festivals/{festival}/tastingSummaries/{tastingSummary} | +[**myFestivalServiceListBookmarks**](MyFestivalServiceApi.md#myfestivalservicelistbookmarks) | **GET** /v1alpha/festivals/{festival}/bookmarks | +[**myFestivalServiceListNotes**](MyFestivalServiceApi.md#myfestivalservicelistnotes) | **GET** /v1alpha/festivals/{festival}/notes | +[**myFestivalServiceListReviewSummaries**](MyFestivalServiceApi.md#myfestivalservicelistreviewsummaries) | **GET** /v1alpha/festivals/{festival}/reviewSummaries | +[**myFestivalServiceListReviews**](MyFestivalServiceApi.md#myfestivalservicelistreviews) | **GET** /v1alpha/festivals/{festival}/reviews | +[**myFestivalServiceListTastingSummaries**](MyFestivalServiceApi.md#myfestivalservicelisttastingsummaries) | **GET** /v1alpha/festivals/{festival}/tastingSummaries | +[**myFestivalServiceListTastings**](MyFestivalServiceApi.md#myfestivalservicelisttastings) | **GET** /v1alpha/festivals/{festival}/tastings | +[**myFestivalServiceUpdateBookmark**](MyFestivalServiceApi.md#myfestivalserviceupdatebookmark) | **PATCH** /v1alpha/festivals/{festival}/drinks/{drink}/bookmark | +[**myFestivalServiceUpdateNote**](MyFestivalServiceApi.md#myfestivalserviceupdatenote) | **PATCH** /v1alpha/festivals/{festival}/drinks/{drink}/note | +[**myFestivalServiceUpdateReview**](MyFestivalServiceApi.md#myfestivalserviceupdatereview) | **PATCH** /v1alpha/festivals/{festival}/drinks/{drink}/review | +[**myFestivalServiceUpdateTasting**](MyFestivalServiceApi.md#myfestivalserviceupdatetasting) | **PATCH** /v1alpha/festivals/{festival}/drinks/{drink}/tasting | + + +# **myFestivalServiceDeleteBookmark** +> myFestivalServiceDeleteBookmark(festival, drink) + + + +Remove the caller's bookmark for a drink. + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final String drink = drink_example; // String | The drink id. + +try { + api.myFestivalServiceDeleteBookmark(festival, drink); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceDeleteBookmark: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **drink** | **String**| The drink id. | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **myFestivalServiceDeleteNote** +> myFestivalServiceDeleteNote(festival, drink) + + + +Remove the caller's tasting note for a drink. + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final String drink = drink_example; // String | The drink id. + +try { + api.myFestivalServiceDeleteNote(festival, drink); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceDeleteNote: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **drink** | **String**| The drink id. | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **myFestivalServiceDeleteReview** +> myFestivalServiceDeleteReview(festival, drink) + + + +Remove the caller's review for a drink. + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final String drink = drink_example; // String | The drink id. + +try { + api.myFestivalServiceDeleteReview(festival, drink); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceDeleteReview: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **drink** | **String**| The drink id. | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **myFestivalServiceDeleteTasting** +> myFestivalServiceDeleteTasting(festival, drink) + + + +Remove the caller's tasting record for a drink. + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final String drink = drink_example; // String | The drink id. + +try { + api.myFestivalServiceDeleteTasting(festival, drink); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceDeleteTasting: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **drink** | **String**| The drink id. | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **myFestivalServiceGetBookmark** +> Bookmark myFestivalServiceGetBookmark(festival, drink) + + + +--- Bookmarks (caller-scoped singletons) --------------------------------- Get the caller's bookmark for a drink. + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final String drink = drink_example; // String | The drink id. + +try { + final response = api.myFestivalServiceGetBookmark(festival, drink); + print(response); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceGetBookmark: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **drink** | **String**| The drink id. | + +### Return type + +[**Bookmark**](Bookmark.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **myFestivalServiceGetNote** +> Note myFestivalServiceGetNote(festival, drink) + + + +--- Tasting notes (caller-scoped singletons) ----------------------------- Get the caller's tasting note for a drink. + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final String drink = drink_example; // String | The drink id. + +try { + final response = api.myFestivalServiceGetNote(festival, drink); + print(response); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceGetNote: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **drink** | **String**| The drink id. | + +### Return type + +[**Note**](Note.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **myFestivalServiceGetReview** +> Review myFestivalServiceGetReview(festival, drink) + + + +--- Personal reviews (caller-scoped singletons) -------------------------- Get the caller's review for a drink. + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final String drink = drink_example; // String | The drink id. + +try { + final response = api.myFestivalServiceGetReview(festival, drink); + print(response); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceGetReview: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **drink** | **String**| The drink id. | + +### Return type + +[**Review**](Review.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **myFestivalServiceGetReviewSummary** +> ReviewSummary myFestivalServiceGetReviewSummary(festival, reviewSummary) + + + +--- Aggregates (public, not caller-scoped) -------------------------------- Get the aggregate review signals for a single drink. + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final String reviewSummary = reviewSummary_example; // String | The reviewSummary id. + +try { + final response = api.myFestivalServiceGetReviewSummary(festival, reviewSummary); + print(response); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceGetReviewSummary: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **reviewSummary** | **String**| The reviewSummary id. | + +### Return type + +[**ReviewSummary**](ReviewSummary.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **myFestivalServiceGetTasting** +> Tasting myFestivalServiceGetTasting(festival, drink) + + + +--- Tasting log (caller-scoped singletons) ------------------------------- Get the caller's tasting record for a drink. + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final String drink = drink_example; // String | The drink id. + +try { + final response = api.myFestivalServiceGetTasting(festival, drink); + print(response); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceGetTasting: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **drink** | **String**| The drink id. | + +### Return type + +[**Tasting**](Tasting.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **myFestivalServiceGetTastingSummary** +> TastingSummary myFestivalServiceGetTastingSummary(festival, tastingSummary) + + + +Get tasting counts for a single drink. + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final String tastingSummary = tastingSummary_example; // String | The tastingSummary id. + +try { + final response = api.myFestivalServiceGetTastingSummary(festival, tastingSummary); + print(response); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceGetTastingSummary: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **tastingSummary** | **String**| The tastingSummary id. | + +### Return type + +[**TastingSummary**](TastingSummary.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **myFestivalServiceListBookmarks** +> ListBookmarksResponse myFestivalServiceListBookmarks(festival, pageSize, pageToken) + + + +List all drinks the caller has bookmarked at a festival. Intended for pre-loading \"my festival\" state on app open. + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final int pageSize = 56; // int | Maximum number of bookmarks to return. The server default returns all of the caller's bookmarks for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. +final String pageToken = pageToken_example; // String | Page token from a previous ListBookmarks response. + +try { + final response = api.myFestivalServiceListBookmarks(festival, pageSize, pageToken); + print(response); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceListBookmarks: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **pageSize** | **int**| Maximum number of bookmarks to return. The server default returns all of the caller's bookmarks for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. | [optional] + **pageToken** | **String**| Page token from a previous ListBookmarks response. | [optional] + +### Return type + +[**ListBookmarksResponse**](ListBookmarksResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **myFestivalServiceListNotes** +> ListNotesResponse myFestivalServiceListNotes(festival, pageSize, pageToken) + + + +List all tasting notes the caller has written at a festival. + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final int pageSize = 56; // int | Maximum number of notes to return. The server default returns all of the caller's notes for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. +final String pageToken = pageToken_example; // String | Page token from a previous ListNotes response. + +try { + final response = api.myFestivalServiceListNotes(festival, pageSize, pageToken); + print(response); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceListNotes: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **pageSize** | **int**| Maximum number of notes to return. The server default returns all of the caller's notes for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. | [optional] + **pageToken** | **String**| Page token from a previous ListNotes response. | [optional] + +### Return type + +[**ListNotesResponse**](ListNotesResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **myFestivalServiceListReviewSummaries** +> ListReviewSummariesResponse myFestivalServiceListReviewSummaries(festival, pageSize, pageToken) + + + +List aggregate review signals for every reviewed drink at a festival. + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final int pageSize = 56; // int | Maximum number of summaries to return. The server default returns all summaries for the festival in a single page (drink counts are bounded). Set explicitly to paginate. +final String pageToken = pageToken_example; // String | Page token from a previous ListReviewSummaries response. + +try { + final response = api.myFestivalServiceListReviewSummaries(festival, pageSize, pageToken); + print(response); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceListReviewSummaries: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **pageSize** | **int**| Maximum number of summaries to return. The server default returns all summaries for the festival in a single page (drink counts are bounded). Set explicitly to paginate. | [optional] + **pageToken** | **String**| Page token from a previous ListReviewSummaries response. | [optional] + +### Return type + +[**ListReviewSummariesResponse**](ListReviewSummariesResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **myFestivalServiceListReviews** +> ListReviewsResponse myFestivalServiceListReviews(festival, pageSize, pageToken) + + + +List all reviews the caller has left for drinks at a festival. Only the caller's own reviews are returned; caller identity is implicit in the auth context. Intended for pre-loading \"my festival\" state on app open. + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final int pageSize = 56; // int | Maximum number of reviews to return. The server default returns all of the caller's reviews for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. +final String pageToken = pageToken_example; // String | Page token from a previous ListReviews response. + +try { + final response = api.myFestivalServiceListReviews(festival, pageSize, pageToken); + print(response); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceListReviews: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **pageSize** | **int**| Maximum number of reviews to return. The server default returns all of the caller's reviews for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. | [optional] + **pageToken** | **String**| Page token from a previous ListReviews response. | [optional] + +### Return type + +[**ListReviewsResponse**](ListReviewsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **myFestivalServiceListTastingSummaries** +> ListTastingSummariesResponse myFestivalServiceListTastingSummaries(festival, pageSize, pageToken) + + + +List tasting counts for every tried drink at a festival. + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final int pageSize = 56; // int | Maximum number of summaries to return. The server default returns all summaries for the festival in a single page (drink counts are bounded). Set explicitly to paginate. +final String pageToken = pageToken_example; // String | Page token from a previous ListTastingSummaries response. + +try { + final response = api.myFestivalServiceListTastingSummaries(festival, pageSize, pageToken); + print(response); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceListTastingSummaries: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **pageSize** | **int**| Maximum number of summaries to return. The server default returns all summaries for the festival in a single page (drink counts are bounded). Set explicitly to paginate. | [optional] + **pageToken** | **String**| Page token from a previous ListTastingSummaries response. | [optional] + +### Return type + +[**ListTastingSummariesResponse**](ListTastingSummariesResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **myFestivalServiceListTastings** +> ListTastingsResponse myFestivalServiceListTastings(festival, pageSize, pageToken) + + + +List all tasting records the caller has logged at a festival. + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final int pageSize = 56; // int | Maximum number of tastings to return. The server default returns all of the caller's tastings for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. +final String pageToken = pageToken_example; // String | Page token from a previous ListTastings response. + +try { + final response = api.myFestivalServiceListTastings(festival, pageSize, pageToken); + print(response); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceListTastings: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **pageSize** | **int**| Maximum number of tastings to return. The server default returns all of the caller's tastings for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. | [optional] + **pageToken** | **String**| Page token from a previous ListTastings response. | [optional] + +### Return type + +[**ListTastingsResponse**](ListTastingsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **myFestivalServiceUpdateBookmark** +> Bookmark myFestivalServiceUpdateBookmark(festival, drink, bookmark, updateMask) + + + +Create or update the caller's bookmark for a drink (upsert). + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final String drink = drink_example; // String | The drink id. +final Bookmark bookmark = ; // Bookmark | +final String updateMask = updateMask_example; // String | Fields to update. Omit to replace all writable fields. + +try { + final response = api.myFestivalServiceUpdateBookmark(festival, drink, bookmark, updateMask); + print(response); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceUpdateBookmark: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **drink** | **String**| The drink id. | + **bookmark** | [**Bookmark**](Bookmark.md)| | + **updateMask** | **String**| Fields to update. Omit to replace all writable fields. | [optional] + +### Return type + +[**Bookmark**](Bookmark.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **myFestivalServiceUpdateNote** +> Note myFestivalServiceUpdateNote(festival, drink, note, updateMask) + + + +Create or update the caller's tasting note for a drink (upsert). + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final String drink = drink_example; // String | The drink id. +final Note note = ; // Note | +final String updateMask = updateMask_example; // String | Fields to update. Omit to replace all writable fields. + +try { + final response = api.myFestivalServiceUpdateNote(festival, drink, note, updateMask); + print(response); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceUpdateNote: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **drink** | **String**| The drink id. | + **note** | [**Note**](Note.md)| | + **updateMask** | **String**| Fields to update. Omit to replace all writable fields. | [optional] + +### Return type + +[**Note**](Note.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **myFestivalServiceUpdateReview** +> Review myFestivalServiceUpdateReview(festival, drink, review, updateMask) + + + +Create or update the caller's review for a drink (upsert). Use `update_mask` to update a single signal (e.g. only `star_rating`) without clearing the other. + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final String drink = drink_example; // String | The drink id. +final Review review = ; // Review | +final String updateMask = updateMask_example; // String | Fields to update. Omit to replace all writable fields. Specify `star_rating` or `would_recommend` individually to update one signal without affecting the other. + +try { + final response = api.myFestivalServiceUpdateReview(festival, drink, review, updateMask); + print(response); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceUpdateReview: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **drink** | **String**| The drink id. | + **review** | [**Review**](Review.md)| | + **updateMask** | **String**| Fields to update. Omit to replace all writable fields. Specify `star_rating` or `would_recommend` individually to update one signal without affecting the other. | [optional] + +### Return type + +[**Review**](Review.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **myFestivalServiceUpdateTasting** +> Tasting myFestivalServiceUpdateTasting(festival, drink, tasting, updateMask) + + + +Create or update the caller's tasting record for a drink (upsert). Use `update_mask` with `pours` to increment the pour count without affecting other fields. + +### Example +```dart +import 'package:myfestival_client/api.dart'; + +final api = MyfestivalClient().getMyFestivalServiceApi(); +final String festival = festival_example; // String | The festival id. +final String drink = drink_example; // String | The drink id. +final Tasting tasting = ; // Tasting | +final String updateMask = updateMask_example; // String | Fields to update. Omit to replace all writable fields. Specify `pours` to update the pour count without affecting other fields. + +try { + final response = api.myFestivalServiceUpdateTasting(festival, drink, tasting, updateMask); + print(response); +} catch on DioException (e) { + print('Exception when calling MyFestivalServiceApi->myFestivalServiceUpdateTasting: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **festival** | **String**| The festival id. | + **drink** | **String**| The drink id. | + **tasting** | [**Tasting**](Tasting.md)| | + **updateMask** | **String**| Fields to update. Omit to replace all writable fields. Specify `pours` to update the pour count without affecting other fields. | [optional] + +### Return type + +[**Tasting**](Tasting.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/packages/myfestival_client/doc/Note.md b/packages/myfestival_client/doc/Note.md new file mode 100644 index 00000000..d1681b05 --- /dev/null +++ b/packages/myfestival_client/doc/Note.md @@ -0,0 +1,17 @@ +# myfestival_client.model.Note + +## Load the model package +```dart +import 'package:myfestival_client/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Resource name: festivals/{festival}/drinks/{drink}/note. | [optional] +**content** | **String** | The caller's note text. Max 2000 Unicode characters. | +**updateTime** | [**DateTime**](DateTime.md) | When this note was last written. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/myfestival_client/doc/Review.md b/packages/myfestival_client/doc/Review.md new file mode 100644 index 00000000..3cf18dec --- /dev/null +++ b/packages/myfestival_client/doc/Review.md @@ -0,0 +1,18 @@ +# myfestival_client.model.Review + +## Load the model package +```dart +import 'package:myfestival_client/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Resource name: festivals/{festival}/drinks/{drink}/review. | [optional] +**starRating** | **int** | Star rating, 1–5 inclusive. Absent if the caller has not set a star rating. | [optional] +**wouldRecommend** | **bool** | Whether the caller would recommend this drink. Absent if not answered. | [optional] +**updateTime** | [**DateTime**](DateTime.md) | When this review was last written. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/myfestival_client/doc/ReviewSummary.md b/packages/myfestival_client/doc/ReviewSummary.md new file mode 100644 index 00000000..3986c2f4 --- /dev/null +++ b/packages/myfestival_client/doc/ReviewSummary.md @@ -0,0 +1,20 @@ +# myfestival_client.model.ReviewSummary + +## Load the model package +```dart +import 'package:myfestival_client/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Resource name: festivals/{festival}/reviewSummaries/{drink}. | [optional] +**ratingCount** | **int** | Number of callers who have submitted a star rating. | [optional] +**averageRating** | **double** | Mean star rating across all callers (1.0–5.0); 0 when rating_count is 0. | [optional] +**responseCount** | **int** | Number of callers who have answered the \"would recommend\" question. | [optional] +**recommendCount** | **int** | Number of callers who answered \"yes\" to the recommendation question. | [optional] +**recommendRate** | **double** | Fraction of responses (0.0–1.0) that would recommend; 0 when response_count is 0. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/myfestival_client/doc/Tasting.md b/packages/myfestival_client/doc/Tasting.md new file mode 100644 index 00000000..febb2b2c --- /dev/null +++ b/packages/myfestival_client/doc/Tasting.md @@ -0,0 +1,18 @@ +# myfestival_client.model.Tasting + +## Load the model package +```dart +import 'package:myfestival_client/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Resource name: festivals/{festival}/drinks/{drink}/tasting. | [optional] +**pours** | **int** | How many times the caller has had this drink. Absent means one pour. Must be >= 1 when present. | [optional] +**createTime** | [**DateTime**](DateTime.md) | When the caller first tried this drink. | [optional] +**updateTime** | [**DateTime**](DateTime.md) | When this record was last updated. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/myfestival_client/doc/TastingSummary.md b/packages/myfestival_client/doc/TastingSummary.md new file mode 100644 index 00000000..d1da1c4d --- /dev/null +++ b/packages/myfestival_client/doc/TastingSummary.md @@ -0,0 +1,17 @@ +# myfestival_client.model.TastingSummary + +## Load the model package +```dart +import 'package:myfestival_client/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Resource name: festivals/{festival}/tastingSummaries/{drink}. | [optional] +**tasterCount** | **int** | Number of distinct callers who have logged a tasting for this drink. | [optional] +**totalPours** | **int** | Total pours logged across all callers. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/myfestival_client/lib/myfestival_client.dart b/packages/myfestival_client/lib/myfestival_client.dart new file mode 100644 index 00000000..5dff89f2 --- /dev/null +++ b/packages/myfestival_client/lib/myfestival_client.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +export 'package:myfestival_client/src/api.dart'; +export 'package:myfestival_client/src/auth/api_key_auth.dart'; +export 'package:myfestival_client/src/auth/basic_auth.dart'; +export 'package:myfestival_client/src/auth/bearer_auth.dart'; +export 'package:myfestival_client/src/auth/oauth.dart'; +export 'package:myfestival_client/src/serializers.dart'; +export 'package:myfestival_client/src/model/date.dart'; + +export 'package:myfestival_client/src/api/my_festival_service_api.dart'; + +export 'package:myfestival_client/src/model/bookmark.dart'; +export 'package:myfestival_client/src/model/list_bookmarks_response.dart'; +export 'package:myfestival_client/src/model/list_notes_response.dart'; +export 'package:myfestival_client/src/model/list_review_summaries_response.dart'; +export 'package:myfestival_client/src/model/list_reviews_response.dart'; +export 'package:myfestival_client/src/model/list_tasting_summaries_response.dart'; +export 'package:myfestival_client/src/model/list_tastings_response.dart'; +export 'package:myfestival_client/src/model/note.dart'; +export 'package:myfestival_client/src/model/review.dart'; +export 'package:myfestival_client/src/model/review_summary.dart'; +export 'package:myfestival_client/src/model/tasting.dart'; +export 'package:myfestival_client/src/model/tasting_summary.dart'; + diff --git a/packages/myfestival_client/lib/src/api.dart b/packages/myfestival_client/lib/src/api.dart new file mode 100644 index 00000000..e399883c --- /dev/null +++ b/packages/myfestival_client/lib/src/api.dart @@ -0,0 +1,73 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:built_value/serializer.dart'; +import 'package:myfestival_client/src/serializers.dart'; +import 'package:myfestival_client/src/auth/api_key_auth.dart'; +import 'package:myfestival_client/src/auth/basic_auth.dart'; +import 'package:myfestival_client/src/auth/bearer_auth.dart'; +import 'package:myfestival_client/src/auth/oauth.dart'; +import 'package:myfestival_client/src/api/my_festival_service_api.dart'; + +class MyfestivalClient { + static const String basePath = r'https://api.cambeerfestival.app'; + + final Dio dio; + final Serializers serializers; + + MyfestivalClient({ + Dio? dio, + Serializers? serializers, + String? basePathOverride, + List? interceptors, + }) : this.serializers = serializers ?? standardSerializers, + this.dio = dio ?? + Dio(BaseOptions( + baseUrl: basePathOverride ?? basePath, + connectTimeout: const Duration(milliseconds: 5000), + receiveTimeout: const Duration(milliseconds: 3000), + )) { + if (interceptors == null) { + this.dio.interceptors.addAll([ + OAuthInterceptor(), + BasicAuthInterceptor(), + BearerAuthInterceptor(), + ApiKeyAuthInterceptor(), + ]); + } else { + this.dio.interceptors.addAll(interceptors); + } + } + + void setOAuthToken(String name, String token) { + if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; + } + } + + void setBearerAuth(String name, String token) { + if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; + } + } + + void setBasicAuth(String name, String username, String password) { + if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); + } + } + + void setApiKey(String name, String apiKey) { + if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { + (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; + } + } + + /// Get MyFestivalServiceApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + MyFestivalServiceApi getMyFestivalServiceApi() { + return MyFestivalServiceApi(dio, serializers); + } +} diff --git a/packages/myfestival_client/lib/src/api/my_festival_service_api.dart b/packages/myfestival_client/lib/src/api/my_festival_service_api.dart new file mode 100644 index 00000000..61d8e847 --- /dev/null +++ b/packages/myfestival_client/lib/src/api/my_festival_service_api.dart @@ -0,0 +1,1629 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'package:built_value/json_object.dart'; +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +import 'package:myfestival_client/src/api_util.dart'; +import 'package:myfestival_client/src/model/bookmark.dart'; +import 'package:myfestival_client/src/model/list_bookmarks_response.dart'; +import 'package:myfestival_client/src/model/list_notes_response.dart'; +import 'package:myfestival_client/src/model/list_review_summaries_response.dart'; +import 'package:myfestival_client/src/model/list_reviews_response.dart'; +import 'package:myfestival_client/src/model/list_tasting_summaries_response.dart'; +import 'package:myfestival_client/src/model/list_tastings_response.dart'; +import 'package:myfestival_client/src/model/note.dart'; +import 'package:myfestival_client/src/model/review.dart'; +import 'package:myfestival_client/src/model/review_summary.dart'; +import 'package:myfestival_client/src/model/tasting.dart'; +import 'package:myfestival_client/src/model/tasting_summary.dart'; + +class MyFestivalServiceApi { + + final Dio _dio; + + final Serializers _serializers; + + const MyFestivalServiceApi(this._dio, this._serializers); + + /// myFestivalServiceDeleteBookmark + /// Remove the caller's bookmark for a drink. + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [drink] - The drink id. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceDeleteBookmark({ + required String festival, + required String drink, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/bookmark'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); + final _options = Options( + method: r'DELETE', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// myFestivalServiceDeleteNote + /// Remove the caller's tasting note for a drink. + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [drink] - The drink id. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceDeleteNote({ + required String festival, + required String drink, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/note'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); + final _options = Options( + method: r'DELETE', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// myFestivalServiceDeleteReview + /// Remove the caller's review for a drink. + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [drink] - The drink id. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceDeleteReview({ + required String festival, + required String drink, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/review'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); + final _options = Options( + method: r'DELETE', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// myFestivalServiceDeleteTasting + /// Remove the caller's tasting record for a drink. + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [drink] - The drink id. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceDeleteTasting({ + required String festival, + required String drink, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/tasting'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); + final _options = Options( + method: r'DELETE', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// myFestivalServiceGetBookmark + /// --- Bookmarks (caller-scoped singletons) --------------------------------- Get the caller's bookmark for a drink. + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [drink] - The drink id. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Bookmark] as data + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceGetBookmark({ + required String festival, + required String drink, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/bookmark'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Bookmark? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(Bookmark), + ) as Bookmark; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// myFestivalServiceGetNote + /// --- Tasting notes (caller-scoped singletons) ----------------------------- Get the caller's tasting note for a drink. + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [drink] - The drink id. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Note] as data + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceGetNote({ + required String festival, + required String drink, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/note'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Note? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(Note), + ) as Note; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// myFestivalServiceGetReview + /// --- Personal reviews (caller-scoped singletons) -------------------------- Get the caller's review for a drink. + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [drink] - The drink id. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Review] as data + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceGetReview({ + required String festival, + required String drink, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/review'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Review? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(Review), + ) as Review; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// myFestivalServiceGetReviewSummary + /// --- Aggregates (public, not caller-scoped) -------------------------------- Get the aggregate review signals for a single drink. + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [reviewSummary] - The reviewSummary id. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ReviewSummary] as data + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceGetReviewSummary({ + required String festival, + required String reviewSummary, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/reviewSummaries/{reviewSummary}'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'reviewSummary' '}', encodeQueryParameter(_serializers, reviewSummary, const FullType(String)).toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ReviewSummary? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(ReviewSummary), + ) as ReviewSummary; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// myFestivalServiceGetTasting + /// --- Tasting log (caller-scoped singletons) ------------------------------- Get the caller's tasting record for a drink. + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [drink] - The drink id. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Tasting] as data + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceGetTasting({ + required String festival, + required String drink, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/tasting'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Tasting? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(Tasting), + ) as Tasting; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// myFestivalServiceGetTastingSummary + /// Get tasting counts for a single drink. + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [tastingSummary] - The tastingSummary id. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [TastingSummary] as data + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceGetTastingSummary({ + required String festival, + required String tastingSummary, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/tastingSummaries/{tastingSummary}'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'tastingSummary' '}', encodeQueryParameter(_serializers, tastingSummary, const FullType(String)).toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + TastingSummary? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(TastingSummary), + ) as TastingSummary; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// myFestivalServiceListBookmarks + /// List all drinks the caller has bookmarked at a festival. Intended for pre-loading \"my festival\" state on app open. + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [pageSize] - Maximum number of bookmarks to return. The server default returns all of the caller's bookmarks for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. + /// * [pageToken] - Page token from a previous ListBookmarks response. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ListBookmarksResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceListBookmarks({ + required String festival, + int? pageSize, + String? pageToken, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/bookmarks'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (pageSize != null) r'pageSize': encodeQueryParameter(_serializers, pageSize, const FullType(int)), + if (pageToken != null) r'pageToken': encodeQueryParameter(_serializers, pageToken, const FullType(String)), + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ListBookmarksResponse? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(ListBookmarksResponse), + ) as ListBookmarksResponse; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// myFestivalServiceListNotes + /// List all tasting notes the caller has written at a festival. + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [pageSize] - Maximum number of notes to return. The server default returns all of the caller's notes for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. + /// * [pageToken] - Page token from a previous ListNotes response. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ListNotesResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceListNotes({ + required String festival, + int? pageSize, + String? pageToken, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/notes'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (pageSize != null) r'pageSize': encodeQueryParameter(_serializers, pageSize, const FullType(int)), + if (pageToken != null) r'pageToken': encodeQueryParameter(_serializers, pageToken, const FullType(String)), + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ListNotesResponse? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(ListNotesResponse), + ) as ListNotesResponse; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// myFestivalServiceListReviewSummaries + /// List aggregate review signals for every reviewed drink at a festival. + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [pageSize] - Maximum number of summaries to return. The server default returns all summaries for the festival in a single page (drink counts are bounded). Set explicitly to paginate. + /// * [pageToken] - Page token from a previous ListReviewSummaries response. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ListReviewSummariesResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceListReviewSummaries({ + required String festival, + int? pageSize, + String? pageToken, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/reviewSummaries'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (pageSize != null) r'pageSize': encodeQueryParameter(_serializers, pageSize, const FullType(int)), + if (pageToken != null) r'pageToken': encodeQueryParameter(_serializers, pageToken, const FullType(String)), + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ListReviewSummariesResponse? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(ListReviewSummariesResponse), + ) as ListReviewSummariesResponse; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// myFestivalServiceListReviews + /// List all reviews the caller has left for drinks at a festival. Only the caller's own reviews are returned; caller identity is implicit in the auth context. Intended for pre-loading \"my festival\" state on app open. + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [pageSize] - Maximum number of reviews to return. The server default returns all of the caller's reviews for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. + /// * [pageToken] - Page token from a previous ListReviews response. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ListReviewsResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceListReviews({ + required String festival, + int? pageSize, + String? pageToken, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/reviews'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (pageSize != null) r'pageSize': encodeQueryParameter(_serializers, pageSize, const FullType(int)), + if (pageToken != null) r'pageToken': encodeQueryParameter(_serializers, pageToken, const FullType(String)), + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ListReviewsResponse? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(ListReviewsResponse), + ) as ListReviewsResponse; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// myFestivalServiceListTastingSummaries + /// List tasting counts for every tried drink at a festival. + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [pageSize] - Maximum number of summaries to return. The server default returns all summaries for the festival in a single page (drink counts are bounded). Set explicitly to paginate. + /// * [pageToken] - Page token from a previous ListTastingSummaries response. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ListTastingSummariesResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceListTastingSummaries({ + required String festival, + int? pageSize, + String? pageToken, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/tastingSummaries'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (pageSize != null) r'pageSize': encodeQueryParameter(_serializers, pageSize, const FullType(int)), + if (pageToken != null) r'pageToken': encodeQueryParameter(_serializers, pageToken, const FullType(String)), + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ListTastingSummariesResponse? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(ListTastingSummariesResponse), + ) as ListTastingSummariesResponse; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// myFestivalServiceListTastings + /// List all tasting records the caller has logged at a festival. + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [pageSize] - Maximum number of tastings to return. The server default returns all of the caller's tastings for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. + /// * [pageToken] - Page token from a previous ListTastings response. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ListTastingsResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceListTastings({ + required String festival, + int? pageSize, + String? pageToken, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/tastings'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (pageSize != null) r'pageSize': encodeQueryParameter(_serializers, pageSize, const FullType(int)), + if (pageToken != null) r'pageToken': encodeQueryParameter(_serializers, pageToken, const FullType(String)), + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ListTastingsResponse? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(ListTastingsResponse), + ) as ListTastingsResponse; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// myFestivalServiceUpdateBookmark + /// Create or update the caller's bookmark for a drink (upsert). + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [drink] - The drink id. + /// * [bookmark] + /// * [updateMask] - Fields to update. Omit to replace all writable fields. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Bookmark] as data + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceUpdateBookmark({ + required String festival, + required String drink, + required Bookmark bookmark, + String? updateMask, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/bookmark'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (updateMask != null) r'updateMask': encodeQueryParameter(_serializers, updateMask, const FullType(String)), + }; + + dynamic _bodyData; + + try { + const _type = FullType(Bookmark); + _bodyData = _serializers.serialize(bookmark, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Bookmark? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(Bookmark), + ) as Bookmark; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// myFestivalServiceUpdateNote + /// Create or update the caller's tasting note for a drink (upsert). + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [drink] - The drink id. + /// * [note] + /// * [updateMask] - Fields to update. Omit to replace all writable fields. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Note] as data + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceUpdateNote({ + required String festival, + required String drink, + required Note note, + String? updateMask, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/note'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (updateMask != null) r'updateMask': encodeQueryParameter(_serializers, updateMask, const FullType(String)), + }; + + dynamic _bodyData; + + try { + const _type = FullType(Note); + _bodyData = _serializers.serialize(note, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Note? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(Note), + ) as Note; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// myFestivalServiceUpdateReview + /// Create or update the caller's review for a drink (upsert). Use `update_mask` to update a single signal (e.g. only `star_rating`) without clearing the other. + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [drink] - The drink id. + /// * [review] + /// * [updateMask] - Fields to update. Omit to replace all writable fields. Specify `star_rating` or `would_recommend` individually to update one signal without affecting the other. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Review] as data + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceUpdateReview({ + required String festival, + required String drink, + required Review review, + String? updateMask, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/review'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (updateMask != null) r'updateMask': encodeQueryParameter(_serializers, updateMask, const FullType(String)), + }; + + dynamic _bodyData; + + try { + const _type = FullType(Review); + _bodyData = _serializers.serialize(review, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Review? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(Review), + ) as Review; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// myFestivalServiceUpdateTasting + /// Create or update the caller's tasting record for a drink (upsert). Use `update_mask` with `pours` to increment the pour count without affecting other fields. + /// + /// Parameters: + /// * [festival] - The festival id. + /// * [drink] - The drink id. + /// * [tasting] + /// * [updateMask] - Fields to update. Omit to replace all writable fields. Specify `pours` to update the pour count without affecting other fields. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Tasting] as data + /// Throws [DioException] if API call or serialization fails + Future> myFestivalServiceUpdateTasting({ + required String festival, + required String drink, + required Tasting tasting, + String? updateMask, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/tasting'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (updateMask != null) r'updateMask': encodeQueryParameter(_serializers, updateMask, const FullType(String)), + }; + + dynamic _bodyData; + + try { + const _type = FullType(Tasting); + _bodyData = _serializers.serialize(tasting, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Tasting? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(Tasting), + ) as Tasting; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/packages/myfestival_client/lib/src/api_util.dart b/packages/myfestival_client/lib/src/api_util.dart new file mode 100644 index 00000000..ed3bb12f --- /dev/null +++ b/packages/myfestival_client/lib/src/api_util.dart @@ -0,0 +1,77 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +/// Format the given form parameter object into something that Dio can handle. +/// Returns primitive or String. +/// Returns List/Map if the value is BuildList/BuiltMap. +dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized is String) { + return serialized; + } + if (value is BuiltList || value is BuiltSet || value is BuiltMap) { + return serialized; + } + return json.encode(serialized); +} + +dynamic encodeQueryParameter( + Serializers serializers, + dynamic value, + FullType type, +) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + if (value is Uint8List) { + // Currently not sure how to serialize this + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized == null) { + return ''; + } + if (serialized is String) { + return serialized; + } + return serialized; +} + +ListParam encodeCollectionQueryParameter( + Serializers serializers, + dynamic value, + FullType type, { + ListFormat format = ListFormat.multi, +}) { + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (value is BuiltList || value is BuiltSet) { + return ListParam(List.of((serialized as Iterable).cast()), format); + } + throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); +} diff --git a/packages/myfestival_client/lib/src/auth/api_key_auth.dart b/packages/myfestival_client/lib/src/auth/api_key_auth.dart new file mode 100644 index 00000000..f7bc151a --- /dev/null +++ b/packages/myfestival_client/lib/src/auth/api_key_auth.dart @@ -0,0 +1,30 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + + +import 'package:dio/dio.dart'; +import 'package:myfestival_client/src/auth/auth.dart'; + +class ApiKeyAuthInterceptor extends AuthInterceptor { + final Map apiKeys = {}; + + @override + void onRequest(RequestOptions options, RequestInterceptorHandler handler) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); + for (final info in authInfo) { + final authName = info['name'] as String; + final authKeyName = info['keyName'] as String; + final authWhere = info['where'] as String; + final apiKey = apiKeys[authName]; + if (apiKey != null) { + if (authWhere == 'query') { + options.queryParameters[authKeyName] = apiKey; + } else { + options.headers[authKeyName] = apiKey; + } + } + } + super.onRequest(options, handler); + } +} diff --git a/packages/myfestival_client/lib/src/auth/auth.dart b/packages/myfestival_client/lib/src/auth/auth.dart new file mode 100644 index 00000000..f7ae9bf3 --- /dev/null +++ b/packages/myfestival_client/lib/src/auth/auth.dart @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; + +abstract class AuthInterceptor extends Interceptor { + /// Get auth information on given route for the given type. + /// Can return an empty list if type is not present on auth data or + /// if route doesn't need authentication. + List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) { + if (route.extra.containsKey('secure')) { + final auth = route.extra['secure'] as List>; + return auth.where((secure) => handles(secure)).toList(); + } + return []; + } +} diff --git a/packages/myfestival_client/lib/src/auth/basic_auth.dart b/packages/myfestival_client/lib/src/auth/basic_auth.dart new file mode 100644 index 00000000..fd421745 --- /dev/null +++ b/packages/myfestival_client/lib/src/auth/basic_auth.dart @@ -0,0 +1,37 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'package:myfestival_client/src/auth/auth.dart'; + +class BasicAuthInfo { + final String username; + final String password; + + const BasicAuthInfo(this.username, this.password); +} + +class BasicAuthInterceptor extends AuthInterceptor { + final Map authInfo = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme']?.toLowerCase() == 'basic') || secure['type'] == 'basic'); + for (final info in metadataAuthInfo) { + final authName = info['name'] as String; + final basicAuthInfo = authInfo[authName]; + if (basicAuthInfo != null) { + final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; + options.headers['Authorization'] = basicAuth; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/packages/myfestival_client/lib/src/auth/bearer_auth.dart b/packages/myfestival_client/lib/src/auth/bearer_auth.dart new file mode 100644 index 00000000..0434e6de --- /dev/null +++ b/packages/myfestival_client/lib/src/auth/bearer_auth.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:myfestival_client/src/auth/auth.dart'; + +class BearerAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme']?.toLowerCase() == 'bearer'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/packages/myfestival_client/lib/src/auth/oauth.dart b/packages/myfestival_client/lib/src/auth/oauth.dart new file mode 100644 index 00000000..9371002b --- /dev/null +++ b/packages/myfestival_client/lib/src/auth/oauth.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:myfestival_client/src/auth/auth.dart'; + +class OAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/packages/myfestival_client/lib/src/date_serializer.dart b/packages/myfestival_client/lib/src/date_serializer.dart new file mode 100644 index 00000000..1f405f19 --- /dev/null +++ b/packages/myfestival_client/lib/src/date_serializer.dart @@ -0,0 +1,31 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:myfestival_client/src/model/date.dart'; + +class DateSerializer implements PrimitiveSerializer { + + const DateSerializer(); + + @override + Iterable get types => BuiltList.of([Date]); + + @override + String get wireName => 'Date'; + + @override + Date deserialize(Serializers serializers, Object serialized, + {FullType specifiedType = FullType.unspecified}) { + final parsed = DateTime.parse(serialized as String); + return Date(parsed.year, parsed.month, parsed.day); + } + + @override + Object serialize(Serializers serializers, Date date, + {FullType specifiedType = FullType.unspecified}) { + return date.toString(); + } +} diff --git a/packages/myfestival_client/lib/src/model/bookmark.dart b/packages/myfestival_client/lib/src/model/bookmark.dart new file mode 100644 index 00000000..ecf0c8fd --- /dev/null +++ b/packages/myfestival_client/lib/src/model/bookmark.dart @@ -0,0 +1,128 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'bookmark.g.dart'; + +/// A drink the caller has bookmarked at a festival. Singleton resource — one per (caller, drink). The resource's mere existence means the drink is bookmarked; deleting it removes the bookmark. The caller is implicit in the auth context. +/// +/// Properties: +/// * [name] - Resource name: festivals/{festival}/drinks/{drink}/bookmark. +/// * [createTime] - When the bookmark was created. +@BuiltValue() +abstract class Bookmark implements Built { + /// Resource name: festivals/{festival}/drinks/{drink}/bookmark. + @BuiltValueField(wireName: r'name') + String? get name; + + /// When the bookmark was created. + @BuiltValueField(wireName: r'createTime') + DateTime? get createTime; + + Bookmark._(); + + factory Bookmark([void updates(BookmarkBuilder b)]) = _$Bookmark; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BookmarkBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$BookmarkSerializer(); +} + +class _$BookmarkSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Bookmark, _$Bookmark]; + + @override + final String wireName = r'Bookmark'; + + Iterable _serializeProperties( + Serializers serializers, + Bookmark object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + if (object.createTime != null) { + yield r'createTime'; + yield serializers.serialize( + object.createTime, + specifiedType: const FullType(DateTime), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Bookmark object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required BookmarkBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + case r'createTime': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(DateTime), + ) as DateTime; + result.createTime = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Bookmark deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BookmarkBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/packages/myfestival_client/lib/src/model/bookmark.g.dart b/packages/myfestival_client/lib/src/model/bookmark.g.dart new file mode 100644 index 00000000..4e9a44ba --- /dev/null +++ b/packages/myfestival_client/lib/src/model/bookmark.g.dart @@ -0,0 +1,101 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'bookmark.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$Bookmark extends Bookmark { + @override + final String? name; + @override + final DateTime? createTime; + + factory _$Bookmark([void Function(BookmarkBuilder)? updates]) => + (BookmarkBuilder()..update(updates))._build(); + + _$Bookmark._({this.name, this.createTime}) : super._(); + @override + Bookmark rebuild(void Function(BookmarkBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + BookmarkBuilder toBuilder() => BookmarkBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is Bookmark && + name == other.name && + createTime == other.createTime; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, createTime.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'Bookmark') + ..add('name', name) + ..add('createTime', createTime)) + .toString(); + } +} + +class BookmarkBuilder implements Builder { + _$Bookmark? _$v; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + DateTime? _createTime; + DateTime? get createTime => _$this._createTime; + set createTime(DateTime? createTime) => _$this._createTime = createTime; + + BookmarkBuilder() { + Bookmark._defaults(this); + } + + BookmarkBuilder get _$this { + final $v = _$v; + if ($v != null) { + _name = $v.name; + _createTime = $v.createTime; + _$v = null; + } + return this; + } + + @override + void replace(Bookmark other) { + _$v = other as _$Bookmark; + } + + @override + void update(void Function(BookmarkBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + Bookmark build() => _build(); + + _$Bookmark _build() { + final _$result = _$v ?? + _$Bookmark._( + name: name, + createTime: createTime, + ); + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/date.dart b/packages/myfestival_client/lib/src/model/date.dart new file mode 100644 index 00000000..b21c7f54 --- /dev/null +++ b/packages/myfestival_client/lib/src/model/date.dart @@ -0,0 +1,70 @@ +/// A gregorian calendar date generated by +/// OpenAPI generator to differentiate +/// between [DateTime] and [Date] formats. +class Date implements Comparable { + final int year; + + /// January is 1. + final int month; + + /// First day is 1. + final int day; + + Date(this.year, this.month, this.day); + + /// The current date + static Date now({bool utc = false}) { + var now = DateTime.now(); + if (utc) { + now = now.toUtc(); + } + return now.toDate(); + } + + /// Convert to a [DateTime]. + DateTime toDateTime({bool utc = false}) { + if (utc) { + return DateTime.utc(year, month, day); + } else { + return DateTime(year, month, day); + } + } + + @override + int compareTo(Date other) { + int d = year.compareTo(other.year); + if (d != 0) { + return d; + } + d = month.compareTo(other.month); + if (d != 0) { + return d; + } + return day.compareTo(other.day); + } + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Date && + runtimeType == other.runtimeType && + year == other.year && + month == other.month && + day == other.day; + + @override + int get hashCode => year.hashCode ^ month.hashCode ^ day.hashCode; + + @override + String toString() { + final yyyy = year.toString(); + final mm = month.toString().padLeft(2, '0'); + final dd = day.toString().padLeft(2, '0'); + + return '$yyyy-$mm-$dd'; + } +} + +extension DateTimeToDate on DateTime { + Date toDate() => Date(year, month, day); +} diff --git a/packages/myfestival_client/lib/src/model/list_bookmarks_response.dart b/packages/myfestival_client/lib/src/model/list_bookmarks_response.dart new file mode 100644 index 00000000..fadb46a3 --- /dev/null +++ b/packages/myfestival_client/lib/src/model/list_bookmarks_response.dart @@ -0,0 +1,149 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:myfestival_client/src/model/bookmark.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'list_bookmarks_response.g.dart'; + +/// Response message for ListBookmarks. +/// +/// Properties: +/// * [bookmarks] - The caller's bookmarks for this page, one per bookmarked drink. +/// * [nextPageToken] - Token for the next page; empty when there are no more results. +/// * [totalSize] - Total number of drinks the caller has bookmarked at this festival. +@BuiltValue() +abstract class ListBookmarksResponse implements Built { + /// The caller's bookmarks for this page, one per bookmarked drink. + @BuiltValueField(wireName: r'bookmarks') + BuiltList? get bookmarks; + + /// Token for the next page; empty when there are no more results. + @BuiltValueField(wireName: r'nextPageToken') + String? get nextPageToken; + + /// Total number of drinks the caller has bookmarked at this festival. + @BuiltValueField(wireName: r'totalSize') + int? get totalSize; + + ListBookmarksResponse._(); + + factory ListBookmarksResponse([void updates(ListBookmarksResponseBuilder b)]) = _$ListBookmarksResponse; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ListBookmarksResponseBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ListBookmarksResponseSerializer(); +} + +class _$ListBookmarksResponseSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ListBookmarksResponse, _$ListBookmarksResponse]; + + @override + final String wireName = r'ListBookmarksResponse'; + + Iterable _serializeProperties( + Serializers serializers, + ListBookmarksResponse object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.bookmarks != null) { + yield r'bookmarks'; + yield serializers.serialize( + object.bookmarks, + specifiedType: const FullType(BuiltList, [FullType(Bookmark)]), + ); + } + if (object.nextPageToken != null) { + yield r'nextPageToken'; + yield serializers.serialize( + object.nextPageToken, + specifiedType: const FullType(String), + ); + } + if (object.totalSize != null) { + yield r'totalSize'; + yield serializers.serialize( + object.totalSize, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ListBookmarksResponse object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ListBookmarksResponseBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'bookmarks': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(Bookmark)]), + ) as BuiltList; + result.bookmarks.replace(valueDes); + break; + case r'nextPageToken': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.nextPageToken = valueDes; + break; + case r'totalSize': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.totalSize = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ListBookmarksResponse deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ListBookmarksResponseBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/packages/myfestival_client/lib/src/model/list_bookmarks_response.g.dart b/packages/myfestival_client/lib/src/model/list_bookmarks_response.g.dart new file mode 100644 index 00000000..27c58f54 --- /dev/null +++ b/packages/myfestival_client/lib/src/model/list_bookmarks_response.g.dart @@ -0,0 +1,134 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'list_bookmarks_response.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$ListBookmarksResponse extends ListBookmarksResponse { + @override + final BuiltList? bookmarks; + @override + final String? nextPageToken; + @override + final int? totalSize; + + factory _$ListBookmarksResponse( + [void Function(ListBookmarksResponseBuilder)? updates]) => + (ListBookmarksResponseBuilder()..update(updates))._build(); + + _$ListBookmarksResponse._( + {this.bookmarks, this.nextPageToken, this.totalSize}) + : super._(); + @override + ListBookmarksResponse rebuild( + void Function(ListBookmarksResponseBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + ListBookmarksResponseBuilder toBuilder() => + ListBookmarksResponseBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is ListBookmarksResponse && + bookmarks == other.bookmarks && + nextPageToken == other.nextPageToken && + totalSize == other.totalSize; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, bookmarks.hashCode); + _$hash = $jc(_$hash, nextPageToken.hashCode); + _$hash = $jc(_$hash, totalSize.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'ListBookmarksResponse') + ..add('bookmarks', bookmarks) + ..add('nextPageToken', nextPageToken) + ..add('totalSize', totalSize)) + .toString(); + } +} + +class ListBookmarksResponseBuilder + implements Builder { + _$ListBookmarksResponse? _$v; + + ListBuilder? _bookmarks; + ListBuilder get bookmarks => + _$this._bookmarks ??= ListBuilder(); + set bookmarks(ListBuilder? bookmarks) => + _$this._bookmarks = bookmarks; + + String? _nextPageToken; + String? get nextPageToken => _$this._nextPageToken; + set nextPageToken(String? nextPageToken) => + _$this._nextPageToken = nextPageToken; + + int? _totalSize; + int? get totalSize => _$this._totalSize; + set totalSize(int? totalSize) => _$this._totalSize = totalSize; + + ListBookmarksResponseBuilder() { + ListBookmarksResponse._defaults(this); + } + + ListBookmarksResponseBuilder get _$this { + final $v = _$v; + if ($v != null) { + _bookmarks = $v.bookmarks?.toBuilder(); + _nextPageToken = $v.nextPageToken; + _totalSize = $v.totalSize; + _$v = null; + } + return this; + } + + @override + void replace(ListBookmarksResponse other) { + _$v = other as _$ListBookmarksResponse; + } + + @override + void update(void Function(ListBookmarksResponseBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + ListBookmarksResponse build() => _build(); + + _$ListBookmarksResponse _build() { + _$ListBookmarksResponse _$result; + try { + _$result = _$v ?? + _$ListBookmarksResponse._( + bookmarks: _bookmarks?.build(), + nextPageToken: nextPageToken, + totalSize: totalSize, + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'bookmarks'; + _bookmarks?.build(); + } catch (e) { + throw BuiltValueNestedFieldError( + r'ListBookmarksResponse', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/list_notes_response.dart b/packages/myfestival_client/lib/src/model/list_notes_response.dart new file mode 100644 index 00000000..e1a49392 --- /dev/null +++ b/packages/myfestival_client/lib/src/model/list_notes_response.dart @@ -0,0 +1,149 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:myfestival_client/src/model/note.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'list_notes_response.g.dart'; + +/// Response message for ListNotes. +/// +/// Properties: +/// * [notes] - The caller's notes for this page, one per noted drink. +/// * [nextPageToken] - Token for the next page; empty when there are no more results. +/// * [totalSize] - Total number of drinks the caller has notes for at this festival. +@BuiltValue() +abstract class ListNotesResponse implements Built { + /// The caller's notes for this page, one per noted drink. + @BuiltValueField(wireName: r'notes') + BuiltList? get notes; + + /// Token for the next page; empty when there are no more results. + @BuiltValueField(wireName: r'nextPageToken') + String? get nextPageToken; + + /// Total number of drinks the caller has notes for at this festival. + @BuiltValueField(wireName: r'totalSize') + int? get totalSize; + + ListNotesResponse._(); + + factory ListNotesResponse([void updates(ListNotesResponseBuilder b)]) = _$ListNotesResponse; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ListNotesResponseBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ListNotesResponseSerializer(); +} + +class _$ListNotesResponseSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ListNotesResponse, _$ListNotesResponse]; + + @override + final String wireName = r'ListNotesResponse'; + + Iterable _serializeProperties( + Serializers serializers, + ListNotesResponse object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.notes != null) { + yield r'notes'; + yield serializers.serialize( + object.notes, + specifiedType: const FullType(BuiltList, [FullType(Note)]), + ); + } + if (object.nextPageToken != null) { + yield r'nextPageToken'; + yield serializers.serialize( + object.nextPageToken, + specifiedType: const FullType(String), + ); + } + if (object.totalSize != null) { + yield r'totalSize'; + yield serializers.serialize( + object.totalSize, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ListNotesResponse object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ListNotesResponseBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'notes': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(Note)]), + ) as BuiltList; + result.notes.replace(valueDes); + break; + case r'nextPageToken': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.nextPageToken = valueDes; + break; + case r'totalSize': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.totalSize = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ListNotesResponse deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ListNotesResponseBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/packages/myfestival_client/lib/src/model/list_notes_response.g.dart b/packages/myfestival_client/lib/src/model/list_notes_response.g.dart new file mode 100644 index 00000000..22c1afec --- /dev/null +++ b/packages/myfestival_client/lib/src/model/list_notes_response.g.dart @@ -0,0 +1,130 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'list_notes_response.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$ListNotesResponse extends ListNotesResponse { + @override + final BuiltList? notes; + @override + final String? nextPageToken; + @override + final int? totalSize; + + factory _$ListNotesResponse( + [void Function(ListNotesResponseBuilder)? updates]) => + (ListNotesResponseBuilder()..update(updates))._build(); + + _$ListNotesResponse._({this.notes, this.nextPageToken, this.totalSize}) + : super._(); + @override + ListNotesResponse rebuild(void Function(ListNotesResponseBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + ListNotesResponseBuilder toBuilder() => + ListNotesResponseBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is ListNotesResponse && + notes == other.notes && + nextPageToken == other.nextPageToken && + totalSize == other.totalSize; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, notes.hashCode); + _$hash = $jc(_$hash, nextPageToken.hashCode); + _$hash = $jc(_$hash, totalSize.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'ListNotesResponse') + ..add('notes', notes) + ..add('nextPageToken', nextPageToken) + ..add('totalSize', totalSize)) + .toString(); + } +} + +class ListNotesResponseBuilder + implements Builder { + _$ListNotesResponse? _$v; + + ListBuilder? _notes; + ListBuilder get notes => _$this._notes ??= ListBuilder(); + set notes(ListBuilder? notes) => _$this._notes = notes; + + String? _nextPageToken; + String? get nextPageToken => _$this._nextPageToken; + set nextPageToken(String? nextPageToken) => + _$this._nextPageToken = nextPageToken; + + int? _totalSize; + int? get totalSize => _$this._totalSize; + set totalSize(int? totalSize) => _$this._totalSize = totalSize; + + ListNotesResponseBuilder() { + ListNotesResponse._defaults(this); + } + + ListNotesResponseBuilder get _$this { + final $v = _$v; + if ($v != null) { + _notes = $v.notes?.toBuilder(); + _nextPageToken = $v.nextPageToken; + _totalSize = $v.totalSize; + _$v = null; + } + return this; + } + + @override + void replace(ListNotesResponse other) { + _$v = other as _$ListNotesResponse; + } + + @override + void update(void Function(ListNotesResponseBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + ListNotesResponse build() => _build(); + + _$ListNotesResponse _build() { + _$ListNotesResponse _$result; + try { + _$result = _$v ?? + _$ListNotesResponse._( + notes: _notes?.build(), + nextPageToken: nextPageToken, + totalSize: totalSize, + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'notes'; + _notes?.build(); + } catch (e) { + throw BuiltValueNestedFieldError( + r'ListNotesResponse', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/list_review_summaries_response.dart b/packages/myfestival_client/lib/src/model/list_review_summaries_response.dart new file mode 100644 index 00000000..c44eda0e --- /dev/null +++ b/packages/myfestival_client/lib/src/model/list_review_summaries_response.dart @@ -0,0 +1,149 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:myfestival_client/src/model/review_summary.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'list_review_summaries_response.g.dart'; + +/// Response message for ListReviewSummaries. +/// +/// Properties: +/// * [reviewSummaries] - Aggregate review signals for this page, one per reviewed drink. +/// * [nextPageToken] - Token for the next page; empty when there are no more results. +/// * [totalSize] - Total number of drinks with at least one review at this festival. +@BuiltValue() +abstract class ListReviewSummariesResponse implements Built { + /// Aggregate review signals for this page, one per reviewed drink. + @BuiltValueField(wireName: r'reviewSummaries') + BuiltList? get reviewSummaries; + + /// Token for the next page; empty when there are no more results. + @BuiltValueField(wireName: r'nextPageToken') + String? get nextPageToken; + + /// Total number of drinks with at least one review at this festival. + @BuiltValueField(wireName: r'totalSize') + int? get totalSize; + + ListReviewSummariesResponse._(); + + factory ListReviewSummariesResponse([void updates(ListReviewSummariesResponseBuilder b)]) = _$ListReviewSummariesResponse; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ListReviewSummariesResponseBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ListReviewSummariesResponseSerializer(); +} + +class _$ListReviewSummariesResponseSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ListReviewSummariesResponse, _$ListReviewSummariesResponse]; + + @override + final String wireName = r'ListReviewSummariesResponse'; + + Iterable _serializeProperties( + Serializers serializers, + ListReviewSummariesResponse object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.reviewSummaries != null) { + yield r'reviewSummaries'; + yield serializers.serialize( + object.reviewSummaries, + specifiedType: const FullType(BuiltList, [FullType(ReviewSummary)]), + ); + } + if (object.nextPageToken != null) { + yield r'nextPageToken'; + yield serializers.serialize( + object.nextPageToken, + specifiedType: const FullType(String), + ); + } + if (object.totalSize != null) { + yield r'totalSize'; + yield serializers.serialize( + object.totalSize, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ListReviewSummariesResponse object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ListReviewSummariesResponseBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'reviewSummaries': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(ReviewSummary)]), + ) as BuiltList; + result.reviewSummaries.replace(valueDes); + break; + case r'nextPageToken': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.nextPageToken = valueDes; + break; + case r'totalSize': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.totalSize = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ListReviewSummariesResponse deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ListReviewSummariesResponseBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/packages/myfestival_client/lib/src/model/list_review_summaries_response.g.dart b/packages/myfestival_client/lib/src/model/list_review_summaries_response.g.dart new file mode 100644 index 00000000..c89ee4c0 --- /dev/null +++ b/packages/myfestival_client/lib/src/model/list_review_summaries_response.g.dart @@ -0,0 +1,136 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'list_review_summaries_response.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$ListReviewSummariesResponse extends ListReviewSummariesResponse { + @override + final BuiltList? reviewSummaries; + @override + final String? nextPageToken; + @override + final int? totalSize; + + factory _$ListReviewSummariesResponse( + [void Function(ListReviewSummariesResponseBuilder)? updates]) => + (ListReviewSummariesResponseBuilder()..update(updates))._build(); + + _$ListReviewSummariesResponse._( + {this.reviewSummaries, this.nextPageToken, this.totalSize}) + : super._(); + @override + ListReviewSummariesResponse rebuild( + void Function(ListReviewSummariesResponseBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + ListReviewSummariesResponseBuilder toBuilder() => + ListReviewSummariesResponseBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is ListReviewSummariesResponse && + reviewSummaries == other.reviewSummaries && + nextPageToken == other.nextPageToken && + totalSize == other.totalSize; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, reviewSummaries.hashCode); + _$hash = $jc(_$hash, nextPageToken.hashCode); + _$hash = $jc(_$hash, totalSize.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'ListReviewSummariesResponse') + ..add('reviewSummaries', reviewSummaries) + ..add('nextPageToken', nextPageToken) + ..add('totalSize', totalSize)) + .toString(); + } +} + +class ListReviewSummariesResponseBuilder + implements + Builder { + _$ListReviewSummariesResponse? _$v; + + ListBuilder? _reviewSummaries; + ListBuilder get reviewSummaries => + _$this._reviewSummaries ??= ListBuilder(); + set reviewSummaries(ListBuilder? reviewSummaries) => + _$this._reviewSummaries = reviewSummaries; + + String? _nextPageToken; + String? get nextPageToken => _$this._nextPageToken; + set nextPageToken(String? nextPageToken) => + _$this._nextPageToken = nextPageToken; + + int? _totalSize; + int? get totalSize => _$this._totalSize; + set totalSize(int? totalSize) => _$this._totalSize = totalSize; + + ListReviewSummariesResponseBuilder() { + ListReviewSummariesResponse._defaults(this); + } + + ListReviewSummariesResponseBuilder get _$this { + final $v = _$v; + if ($v != null) { + _reviewSummaries = $v.reviewSummaries?.toBuilder(); + _nextPageToken = $v.nextPageToken; + _totalSize = $v.totalSize; + _$v = null; + } + return this; + } + + @override + void replace(ListReviewSummariesResponse other) { + _$v = other as _$ListReviewSummariesResponse; + } + + @override + void update(void Function(ListReviewSummariesResponseBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + ListReviewSummariesResponse build() => _build(); + + _$ListReviewSummariesResponse _build() { + _$ListReviewSummariesResponse _$result; + try { + _$result = _$v ?? + _$ListReviewSummariesResponse._( + reviewSummaries: _reviewSummaries?.build(), + nextPageToken: nextPageToken, + totalSize: totalSize, + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'reviewSummaries'; + _reviewSummaries?.build(); + } catch (e) { + throw BuiltValueNestedFieldError( + r'ListReviewSummariesResponse', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/list_reviews_response.dart b/packages/myfestival_client/lib/src/model/list_reviews_response.dart new file mode 100644 index 00000000..80fbbf95 --- /dev/null +++ b/packages/myfestival_client/lib/src/model/list_reviews_response.dart @@ -0,0 +1,149 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:myfestival_client/src/model/review.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'list_reviews_response.g.dart'; + +/// Response message for ListReviews. +/// +/// Properties: +/// * [reviews] - The caller's reviews for this page, one per reviewed drink. +/// * [nextPageToken] - Token for the next page; empty when there are no more results. +/// * [totalSize] - Total number of drinks the caller has reviewed at this festival. +@BuiltValue() +abstract class ListReviewsResponse implements Built { + /// The caller's reviews for this page, one per reviewed drink. + @BuiltValueField(wireName: r'reviews') + BuiltList? get reviews; + + /// Token for the next page; empty when there are no more results. + @BuiltValueField(wireName: r'nextPageToken') + String? get nextPageToken; + + /// Total number of drinks the caller has reviewed at this festival. + @BuiltValueField(wireName: r'totalSize') + int? get totalSize; + + ListReviewsResponse._(); + + factory ListReviewsResponse([void updates(ListReviewsResponseBuilder b)]) = _$ListReviewsResponse; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ListReviewsResponseBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ListReviewsResponseSerializer(); +} + +class _$ListReviewsResponseSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ListReviewsResponse, _$ListReviewsResponse]; + + @override + final String wireName = r'ListReviewsResponse'; + + Iterable _serializeProperties( + Serializers serializers, + ListReviewsResponse object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.reviews != null) { + yield r'reviews'; + yield serializers.serialize( + object.reviews, + specifiedType: const FullType(BuiltList, [FullType(Review)]), + ); + } + if (object.nextPageToken != null) { + yield r'nextPageToken'; + yield serializers.serialize( + object.nextPageToken, + specifiedType: const FullType(String), + ); + } + if (object.totalSize != null) { + yield r'totalSize'; + yield serializers.serialize( + object.totalSize, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ListReviewsResponse object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ListReviewsResponseBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'reviews': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(Review)]), + ) as BuiltList; + result.reviews.replace(valueDes); + break; + case r'nextPageToken': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.nextPageToken = valueDes; + break; + case r'totalSize': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.totalSize = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ListReviewsResponse deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ListReviewsResponseBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/packages/myfestival_client/lib/src/model/list_reviews_response.g.dart b/packages/myfestival_client/lib/src/model/list_reviews_response.g.dart new file mode 100644 index 00000000..ffecd808 --- /dev/null +++ b/packages/myfestival_client/lib/src/model/list_reviews_response.g.dart @@ -0,0 +1,131 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'list_reviews_response.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$ListReviewsResponse extends ListReviewsResponse { + @override + final BuiltList? reviews; + @override + final String? nextPageToken; + @override + final int? totalSize; + + factory _$ListReviewsResponse( + [void Function(ListReviewsResponseBuilder)? updates]) => + (ListReviewsResponseBuilder()..update(updates))._build(); + + _$ListReviewsResponse._({this.reviews, this.nextPageToken, this.totalSize}) + : super._(); + @override + ListReviewsResponse rebuild( + void Function(ListReviewsResponseBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + ListReviewsResponseBuilder toBuilder() => + ListReviewsResponseBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is ListReviewsResponse && + reviews == other.reviews && + nextPageToken == other.nextPageToken && + totalSize == other.totalSize; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, reviews.hashCode); + _$hash = $jc(_$hash, nextPageToken.hashCode); + _$hash = $jc(_$hash, totalSize.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'ListReviewsResponse') + ..add('reviews', reviews) + ..add('nextPageToken', nextPageToken) + ..add('totalSize', totalSize)) + .toString(); + } +} + +class ListReviewsResponseBuilder + implements Builder { + _$ListReviewsResponse? _$v; + + ListBuilder? _reviews; + ListBuilder get reviews => _$this._reviews ??= ListBuilder(); + set reviews(ListBuilder? reviews) => _$this._reviews = reviews; + + String? _nextPageToken; + String? get nextPageToken => _$this._nextPageToken; + set nextPageToken(String? nextPageToken) => + _$this._nextPageToken = nextPageToken; + + int? _totalSize; + int? get totalSize => _$this._totalSize; + set totalSize(int? totalSize) => _$this._totalSize = totalSize; + + ListReviewsResponseBuilder() { + ListReviewsResponse._defaults(this); + } + + ListReviewsResponseBuilder get _$this { + final $v = _$v; + if ($v != null) { + _reviews = $v.reviews?.toBuilder(); + _nextPageToken = $v.nextPageToken; + _totalSize = $v.totalSize; + _$v = null; + } + return this; + } + + @override + void replace(ListReviewsResponse other) { + _$v = other as _$ListReviewsResponse; + } + + @override + void update(void Function(ListReviewsResponseBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + ListReviewsResponse build() => _build(); + + _$ListReviewsResponse _build() { + _$ListReviewsResponse _$result; + try { + _$result = _$v ?? + _$ListReviewsResponse._( + reviews: _reviews?.build(), + nextPageToken: nextPageToken, + totalSize: totalSize, + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'reviews'; + _reviews?.build(); + } catch (e) { + throw BuiltValueNestedFieldError( + r'ListReviewsResponse', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/list_tasting_summaries_response.dart b/packages/myfestival_client/lib/src/model/list_tasting_summaries_response.dart new file mode 100644 index 00000000..2490fffb --- /dev/null +++ b/packages/myfestival_client/lib/src/model/list_tasting_summaries_response.dart @@ -0,0 +1,149 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:myfestival_client/src/model/tasting_summary.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'list_tasting_summaries_response.g.dart'; + +/// Response message for ListTastingSummaries. +/// +/// Properties: +/// * [tastingSummaries] - Tasting counts for this page, one per tried drink. +/// * [nextPageToken] - Token for the next page; empty when there are no more results. +/// * [totalSize] - Total number of drinks tried by at least one caller at this festival. +@BuiltValue() +abstract class ListTastingSummariesResponse implements Built { + /// Tasting counts for this page, one per tried drink. + @BuiltValueField(wireName: r'tastingSummaries') + BuiltList? get tastingSummaries; + + /// Token for the next page; empty when there are no more results. + @BuiltValueField(wireName: r'nextPageToken') + String? get nextPageToken; + + /// Total number of drinks tried by at least one caller at this festival. + @BuiltValueField(wireName: r'totalSize') + int? get totalSize; + + ListTastingSummariesResponse._(); + + factory ListTastingSummariesResponse([void updates(ListTastingSummariesResponseBuilder b)]) = _$ListTastingSummariesResponse; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ListTastingSummariesResponseBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ListTastingSummariesResponseSerializer(); +} + +class _$ListTastingSummariesResponseSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ListTastingSummariesResponse, _$ListTastingSummariesResponse]; + + @override + final String wireName = r'ListTastingSummariesResponse'; + + Iterable _serializeProperties( + Serializers serializers, + ListTastingSummariesResponse object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.tastingSummaries != null) { + yield r'tastingSummaries'; + yield serializers.serialize( + object.tastingSummaries, + specifiedType: const FullType(BuiltList, [FullType(TastingSummary)]), + ); + } + if (object.nextPageToken != null) { + yield r'nextPageToken'; + yield serializers.serialize( + object.nextPageToken, + specifiedType: const FullType(String), + ); + } + if (object.totalSize != null) { + yield r'totalSize'; + yield serializers.serialize( + object.totalSize, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ListTastingSummariesResponse object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ListTastingSummariesResponseBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'tastingSummaries': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(TastingSummary)]), + ) as BuiltList; + result.tastingSummaries.replace(valueDes); + break; + case r'nextPageToken': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.nextPageToken = valueDes; + break; + case r'totalSize': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.totalSize = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ListTastingSummariesResponse deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ListTastingSummariesResponseBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/packages/myfestival_client/lib/src/model/list_tasting_summaries_response.g.dart b/packages/myfestival_client/lib/src/model/list_tasting_summaries_response.g.dart new file mode 100644 index 00000000..c143dab2 --- /dev/null +++ b/packages/myfestival_client/lib/src/model/list_tasting_summaries_response.g.dart @@ -0,0 +1,136 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'list_tasting_summaries_response.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$ListTastingSummariesResponse extends ListTastingSummariesResponse { + @override + final BuiltList? tastingSummaries; + @override + final String? nextPageToken; + @override + final int? totalSize; + + factory _$ListTastingSummariesResponse( + [void Function(ListTastingSummariesResponseBuilder)? updates]) => + (ListTastingSummariesResponseBuilder()..update(updates))._build(); + + _$ListTastingSummariesResponse._( + {this.tastingSummaries, this.nextPageToken, this.totalSize}) + : super._(); + @override + ListTastingSummariesResponse rebuild( + void Function(ListTastingSummariesResponseBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + ListTastingSummariesResponseBuilder toBuilder() => + ListTastingSummariesResponseBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is ListTastingSummariesResponse && + tastingSummaries == other.tastingSummaries && + nextPageToken == other.nextPageToken && + totalSize == other.totalSize; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, tastingSummaries.hashCode); + _$hash = $jc(_$hash, nextPageToken.hashCode); + _$hash = $jc(_$hash, totalSize.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'ListTastingSummariesResponse') + ..add('tastingSummaries', tastingSummaries) + ..add('nextPageToken', nextPageToken) + ..add('totalSize', totalSize)) + .toString(); + } +} + +class ListTastingSummariesResponseBuilder + implements + Builder { + _$ListTastingSummariesResponse? _$v; + + ListBuilder? _tastingSummaries; + ListBuilder get tastingSummaries => + _$this._tastingSummaries ??= ListBuilder(); + set tastingSummaries(ListBuilder? tastingSummaries) => + _$this._tastingSummaries = tastingSummaries; + + String? _nextPageToken; + String? get nextPageToken => _$this._nextPageToken; + set nextPageToken(String? nextPageToken) => + _$this._nextPageToken = nextPageToken; + + int? _totalSize; + int? get totalSize => _$this._totalSize; + set totalSize(int? totalSize) => _$this._totalSize = totalSize; + + ListTastingSummariesResponseBuilder() { + ListTastingSummariesResponse._defaults(this); + } + + ListTastingSummariesResponseBuilder get _$this { + final $v = _$v; + if ($v != null) { + _tastingSummaries = $v.tastingSummaries?.toBuilder(); + _nextPageToken = $v.nextPageToken; + _totalSize = $v.totalSize; + _$v = null; + } + return this; + } + + @override + void replace(ListTastingSummariesResponse other) { + _$v = other as _$ListTastingSummariesResponse; + } + + @override + void update(void Function(ListTastingSummariesResponseBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + ListTastingSummariesResponse build() => _build(); + + _$ListTastingSummariesResponse _build() { + _$ListTastingSummariesResponse _$result; + try { + _$result = _$v ?? + _$ListTastingSummariesResponse._( + tastingSummaries: _tastingSummaries?.build(), + nextPageToken: nextPageToken, + totalSize: totalSize, + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'tastingSummaries'; + _tastingSummaries?.build(); + } catch (e) { + throw BuiltValueNestedFieldError( + r'ListTastingSummariesResponse', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/list_tastings_response.dart b/packages/myfestival_client/lib/src/model/list_tastings_response.dart new file mode 100644 index 00000000..ee79b130 --- /dev/null +++ b/packages/myfestival_client/lib/src/model/list_tastings_response.dart @@ -0,0 +1,149 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:myfestival_client/src/model/tasting.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'list_tastings_response.g.dart'; + +/// Response message for ListTastings. +/// +/// Properties: +/// * [tastings] - The caller's tasting records for this page, one per tried drink. +/// * [nextPageToken] - Token for the next page; empty when there are no more results. +/// * [totalSize] - Total number of drinks the caller has tried at this festival. +@BuiltValue() +abstract class ListTastingsResponse implements Built { + /// The caller's tasting records for this page, one per tried drink. + @BuiltValueField(wireName: r'tastings') + BuiltList? get tastings; + + /// Token for the next page; empty when there are no more results. + @BuiltValueField(wireName: r'nextPageToken') + String? get nextPageToken; + + /// Total number of drinks the caller has tried at this festival. + @BuiltValueField(wireName: r'totalSize') + int? get totalSize; + + ListTastingsResponse._(); + + factory ListTastingsResponse([void updates(ListTastingsResponseBuilder b)]) = _$ListTastingsResponse; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ListTastingsResponseBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ListTastingsResponseSerializer(); +} + +class _$ListTastingsResponseSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ListTastingsResponse, _$ListTastingsResponse]; + + @override + final String wireName = r'ListTastingsResponse'; + + Iterable _serializeProperties( + Serializers serializers, + ListTastingsResponse object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.tastings != null) { + yield r'tastings'; + yield serializers.serialize( + object.tastings, + specifiedType: const FullType(BuiltList, [FullType(Tasting)]), + ); + } + if (object.nextPageToken != null) { + yield r'nextPageToken'; + yield serializers.serialize( + object.nextPageToken, + specifiedType: const FullType(String), + ); + } + if (object.totalSize != null) { + yield r'totalSize'; + yield serializers.serialize( + object.totalSize, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ListTastingsResponse object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ListTastingsResponseBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'tastings': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(Tasting)]), + ) as BuiltList; + result.tastings.replace(valueDes); + break; + case r'nextPageToken': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.nextPageToken = valueDes; + break; + case r'totalSize': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.totalSize = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ListTastingsResponse deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ListTastingsResponseBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/packages/myfestival_client/lib/src/model/list_tastings_response.g.dart b/packages/myfestival_client/lib/src/model/list_tastings_response.g.dart new file mode 100644 index 00000000..f9b2fc5a --- /dev/null +++ b/packages/myfestival_client/lib/src/model/list_tastings_response.g.dart @@ -0,0 +1,132 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'list_tastings_response.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$ListTastingsResponse extends ListTastingsResponse { + @override + final BuiltList? tastings; + @override + final String? nextPageToken; + @override + final int? totalSize; + + factory _$ListTastingsResponse( + [void Function(ListTastingsResponseBuilder)? updates]) => + (ListTastingsResponseBuilder()..update(updates))._build(); + + _$ListTastingsResponse._({this.tastings, this.nextPageToken, this.totalSize}) + : super._(); + @override + ListTastingsResponse rebuild( + void Function(ListTastingsResponseBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + ListTastingsResponseBuilder toBuilder() => + ListTastingsResponseBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is ListTastingsResponse && + tastings == other.tastings && + nextPageToken == other.nextPageToken && + totalSize == other.totalSize; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, tastings.hashCode); + _$hash = $jc(_$hash, nextPageToken.hashCode); + _$hash = $jc(_$hash, totalSize.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'ListTastingsResponse') + ..add('tastings', tastings) + ..add('nextPageToken', nextPageToken) + ..add('totalSize', totalSize)) + .toString(); + } +} + +class ListTastingsResponseBuilder + implements Builder { + _$ListTastingsResponse? _$v; + + ListBuilder? _tastings; + ListBuilder get tastings => + _$this._tastings ??= ListBuilder(); + set tastings(ListBuilder? tastings) => _$this._tastings = tastings; + + String? _nextPageToken; + String? get nextPageToken => _$this._nextPageToken; + set nextPageToken(String? nextPageToken) => + _$this._nextPageToken = nextPageToken; + + int? _totalSize; + int? get totalSize => _$this._totalSize; + set totalSize(int? totalSize) => _$this._totalSize = totalSize; + + ListTastingsResponseBuilder() { + ListTastingsResponse._defaults(this); + } + + ListTastingsResponseBuilder get _$this { + final $v = _$v; + if ($v != null) { + _tastings = $v.tastings?.toBuilder(); + _nextPageToken = $v.nextPageToken; + _totalSize = $v.totalSize; + _$v = null; + } + return this; + } + + @override + void replace(ListTastingsResponse other) { + _$v = other as _$ListTastingsResponse; + } + + @override + void update(void Function(ListTastingsResponseBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + ListTastingsResponse build() => _build(); + + _$ListTastingsResponse _build() { + _$ListTastingsResponse _$result; + try { + _$result = _$v ?? + _$ListTastingsResponse._( + tastings: _tastings?.build(), + nextPageToken: nextPageToken, + totalSize: totalSize, + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'tastings'; + _tastings?.build(); + } catch (e) { + throw BuiltValueNestedFieldError( + r'ListTastingsResponse', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/note.dart b/packages/myfestival_client/lib/src/model/note.dart new file mode 100644 index 00000000..0edb85a8 --- /dev/null +++ b/packages/myfestival_client/lib/src/model/note.dart @@ -0,0 +1,145 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'note.g.dart'; + +/// The caller's free-text tasting note for one drink at one festival. Singleton resource — one per (caller, drink). The caller is implicit in the auth context. A note is independent of a Review: you can note without rating, or rate without noting. +/// +/// Properties: +/// * [name] - Resource name: festivals/{festival}/drinks/{drink}/note. +/// * [content] - The caller's note text. Max 2000 Unicode characters. +/// * [updateTime] - When this note was last written. +@BuiltValue() +abstract class Note implements Built { + /// Resource name: festivals/{festival}/drinks/{drink}/note. + @BuiltValueField(wireName: r'name') + String? get name; + + /// The caller's note text. Max 2000 Unicode characters. + @BuiltValueField(wireName: r'content') + String get content; + + /// When this note was last written. + @BuiltValueField(wireName: r'updateTime') + DateTime? get updateTime; + + Note._(); + + factory Note([void updates(NoteBuilder b)]) = _$Note; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(NoteBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$NoteSerializer(); +} + +class _$NoteSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Note, _$Note]; + + @override + final String wireName = r'Note'; + + Iterable _serializeProperties( + Serializers serializers, + Note object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + yield r'content'; + yield serializers.serialize( + object.content, + specifiedType: const FullType(String), + ); + if (object.updateTime != null) { + yield r'updateTime'; + yield serializers.serialize( + object.updateTime, + specifiedType: const FullType(DateTime), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Note object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required NoteBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + case r'content': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.content = valueDes; + break; + case r'updateTime': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(DateTime), + ) as DateTime; + result.updateTime = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Note deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = NoteBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/packages/myfestival_client/lib/src/model/note.g.dart b/packages/myfestival_client/lib/src/model/note.g.dart new file mode 100644 index 00000000..86e5bea1 --- /dev/null +++ b/packages/myfestival_client/lib/src/model/note.g.dart @@ -0,0 +1,113 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'note.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$Note extends Note { + @override + final String? name; + @override + final String content; + @override + final DateTime? updateTime; + + factory _$Note([void Function(NoteBuilder)? updates]) => + (NoteBuilder()..update(updates))._build(); + + _$Note._({this.name, required this.content, this.updateTime}) : super._(); + @override + Note rebuild(void Function(NoteBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + NoteBuilder toBuilder() => NoteBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is Note && + name == other.name && + content == other.content && + updateTime == other.updateTime; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, content.hashCode); + _$hash = $jc(_$hash, updateTime.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'Note') + ..add('name', name) + ..add('content', content) + ..add('updateTime', updateTime)) + .toString(); + } +} + +class NoteBuilder implements Builder { + _$Note? _$v; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + String? _content; + String? get content => _$this._content; + set content(String? content) => _$this._content = content; + + DateTime? _updateTime; + DateTime? get updateTime => _$this._updateTime; + set updateTime(DateTime? updateTime) => _$this._updateTime = updateTime; + + NoteBuilder() { + Note._defaults(this); + } + + NoteBuilder get _$this { + final $v = _$v; + if ($v != null) { + _name = $v.name; + _content = $v.content; + _updateTime = $v.updateTime; + _$v = null; + } + return this; + } + + @override + void replace(Note other) { + _$v = other as _$Note; + } + + @override + void update(void Function(NoteBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + Note build() => _build(); + + _$Note _build() { + final _$result = _$v ?? + _$Note._( + name: name, + content: BuiltValueNullFieldError.checkNotNull( + content, r'Note', 'content'), + updateTime: updateTime, + ); + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/review.dart b/packages/myfestival_client/lib/src/model/review.dart new file mode 100644 index 00000000..ad2c93d4 --- /dev/null +++ b/packages/myfestival_client/lib/src/model/review.dart @@ -0,0 +1,166 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'review.g.dart'; + +/// The caller's review of one drink at one festival: a star rating (1-5) and/or a \"would recommend\" answer. Singleton resource — one per (caller, drink). The caller is implicit in the auth context; their identity never appears in the resource name, keeping device IDs private and making the sign-in upgrade transparent to clients. Both signals are optional and independent: a caller can rate without answering the recommendation question, or vice versa. +/// +/// Properties: +/// * [name] - Resource name: festivals/{festival}/drinks/{drink}/review. +/// * [starRating] - Star rating, 1–5 inclusive. Absent if the caller has not set a star rating. +/// * [wouldRecommend] - Whether the caller would recommend this drink. Absent if not answered. +/// * [updateTime] - When this review was last written. +@BuiltValue() +abstract class Review implements Built { + /// Resource name: festivals/{festival}/drinks/{drink}/review. + @BuiltValueField(wireName: r'name') + String? get name; + + /// Star rating, 1–5 inclusive. Absent if the caller has not set a star rating. + @BuiltValueField(wireName: r'starRating') + int? get starRating; + + /// Whether the caller would recommend this drink. Absent if not answered. + @BuiltValueField(wireName: r'wouldRecommend') + bool? get wouldRecommend; + + /// When this review was last written. + @BuiltValueField(wireName: r'updateTime') + DateTime? get updateTime; + + Review._(); + + factory Review([void updates(ReviewBuilder b)]) = _$Review; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ReviewBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ReviewSerializer(); +} + +class _$ReviewSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Review, _$Review]; + + @override + final String wireName = r'Review'; + + Iterable _serializeProperties( + Serializers serializers, + Review object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + if (object.starRating != null) { + yield r'starRating'; + yield serializers.serialize( + object.starRating, + specifiedType: const FullType(int), + ); + } + if (object.wouldRecommend != null) { + yield r'wouldRecommend'; + yield serializers.serialize( + object.wouldRecommend, + specifiedType: const FullType(bool), + ); + } + if (object.updateTime != null) { + yield r'updateTime'; + yield serializers.serialize( + object.updateTime, + specifiedType: const FullType(DateTime), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Review object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ReviewBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + case r'starRating': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.starRating = valueDes; + break; + case r'wouldRecommend': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.wouldRecommend = valueDes; + break; + case r'updateTime': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(DateTime), + ) as DateTime; + result.updateTime = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Review deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ReviewBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/packages/myfestival_client/lib/src/model/review.g.dart b/packages/myfestival_client/lib/src/model/review.g.dart new file mode 100644 index 00000000..164f820c --- /dev/null +++ b/packages/myfestival_client/lib/src/model/review.g.dart @@ -0,0 +1,125 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'review.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$Review extends Review { + @override + final String? name; + @override + final int? starRating; + @override + final bool? wouldRecommend; + @override + final DateTime? updateTime; + + factory _$Review([void Function(ReviewBuilder)? updates]) => + (ReviewBuilder()..update(updates))._build(); + + _$Review._({this.name, this.starRating, this.wouldRecommend, this.updateTime}) + : super._(); + @override + Review rebuild(void Function(ReviewBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + ReviewBuilder toBuilder() => ReviewBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is Review && + name == other.name && + starRating == other.starRating && + wouldRecommend == other.wouldRecommend && + updateTime == other.updateTime; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, starRating.hashCode); + _$hash = $jc(_$hash, wouldRecommend.hashCode); + _$hash = $jc(_$hash, updateTime.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'Review') + ..add('name', name) + ..add('starRating', starRating) + ..add('wouldRecommend', wouldRecommend) + ..add('updateTime', updateTime)) + .toString(); + } +} + +class ReviewBuilder implements Builder { + _$Review? _$v; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + int? _starRating; + int? get starRating => _$this._starRating; + set starRating(int? starRating) => _$this._starRating = starRating; + + bool? _wouldRecommend; + bool? get wouldRecommend => _$this._wouldRecommend; + set wouldRecommend(bool? wouldRecommend) => + _$this._wouldRecommend = wouldRecommend; + + DateTime? _updateTime; + DateTime? get updateTime => _$this._updateTime; + set updateTime(DateTime? updateTime) => _$this._updateTime = updateTime; + + ReviewBuilder() { + Review._defaults(this); + } + + ReviewBuilder get _$this { + final $v = _$v; + if ($v != null) { + _name = $v.name; + _starRating = $v.starRating; + _wouldRecommend = $v.wouldRecommend; + _updateTime = $v.updateTime; + _$v = null; + } + return this; + } + + @override + void replace(Review other) { + _$v = other as _$Review; + } + + @override + void update(void Function(ReviewBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + Review build() => _build(); + + _$Review _build() { + final _$result = _$v ?? + _$Review._( + name: name, + starRating: starRating, + wouldRecommend: wouldRecommend, + updateTime: updateTime, + ); + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/review_summary.dart b/packages/myfestival_client/lib/src/model/review_summary.dart new file mode 100644 index 00000000..ff197ef8 --- /dev/null +++ b/packages/myfestival_client/lib/src/model/review_summary.dart @@ -0,0 +1,204 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'review_summary.g.dart'; + +/// Computed, read-only aggregate of all callers' reviews for one drink. Keyed by drink under the festival so the whole festival can be fetched in one paginated call for list/grid views. +/// +/// Properties: +/// * [name] - Resource name: festivals/{festival}/reviewSummaries/{drink}. +/// * [ratingCount] - Number of callers who have submitted a star rating. +/// * [averageRating] - Mean star rating across all callers (1.0–5.0); 0 when rating_count is 0. +/// * [responseCount] - Number of callers who have answered the \"would recommend\" question. +/// * [recommendCount] - Number of callers who answered \"yes\" to the recommendation question. +/// * [recommendRate] - Fraction of responses (0.0–1.0) that would recommend; 0 when response_count is 0. +@BuiltValue() +abstract class ReviewSummary implements Built { + /// Resource name: festivals/{festival}/reviewSummaries/{drink}. + @BuiltValueField(wireName: r'name') + String? get name; + + /// Number of callers who have submitted a star rating. + @BuiltValueField(wireName: r'ratingCount') + int? get ratingCount; + + /// Mean star rating across all callers (1.0–5.0); 0 when rating_count is 0. + @BuiltValueField(wireName: r'averageRating') + double? get averageRating; + + /// Number of callers who have answered the \"would recommend\" question. + @BuiltValueField(wireName: r'responseCount') + int? get responseCount; + + /// Number of callers who answered \"yes\" to the recommendation question. + @BuiltValueField(wireName: r'recommendCount') + int? get recommendCount; + + /// Fraction of responses (0.0–1.0) that would recommend; 0 when response_count is 0. + @BuiltValueField(wireName: r'recommendRate') + double? get recommendRate; + + ReviewSummary._(); + + factory ReviewSummary([void updates(ReviewSummaryBuilder b)]) = _$ReviewSummary; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ReviewSummaryBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ReviewSummarySerializer(); +} + +class _$ReviewSummarySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ReviewSummary, _$ReviewSummary]; + + @override + final String wireName = r'ReviewSummary'; + + Iterable _serializeProperties( + Serializers serializers, + ReviewSummary object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + if (object.ratingCount != null) { + yield r'ratingCount'; + yield serializers.serialize( + object.ratingCount, + specifiedType: const FullType(int), + ); + } + if (object.averageRating != null) { + yield r'averageRating'; + yield serializers.serialize( + object.averageRating, + specifiedType: const FullType(double), + ); + } + if (object.responseCount != null) { + yield r'responseCount'; + yield serializers.serialize( + object.responseCount, + specifiedType: const FullType(int), + ); + } + if (object.recommendCount != null) { + yield r'recommendCount'; + yield serializers.serialize( + object.recommendCount, + specifiedType: const FullType(int), + ); + } + if (object.recommendRate != null) { + yield r'recommendRate'; + yield serializers.serialize( + object.recommendRate, + specifiedType: const FullType(double), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ReviewSummary object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ReviewSummaryBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + case r'ratingCount': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.ratingCount = valueDes; + break; + case r'averageRating': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(double), + ) as double; + result.averageRating = valueDes; + break; + case r'responseCount': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.responseCount = valueDes; + break; + case r'recommendCount': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.recommendCount = valueDes; + break; + case r'recommendRate': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(double), + ) as double; + result.recommendRate = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ReviewSummary deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ReviewSummaryBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/packages/myfestival_client/lib/src/model/review_summary.g.dart b/packages/myfestival_client/lib/src/model/review_summary.g.dart new file mode 100644 index 00000000..643928c6 --- /dev/null +++ b/packages/myfestival_client/lib/src/model/review_summary.g.dart @@ -0,0 +1,157 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'review_summary.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$ReviewSummary extends ReviewSummary { + @override + final String? name; + @override + final int? ratingCount; + @override + final double? averageRating; + @override + final int? responseCount; + @override + final int? recommendCount; + @override + final double? recommendRate; + + factory _$ReviewSummary([void Function(ReviewSummaryBuilder)? updates]) => + (ReviewSummaryBuilder()..update(updates))._build(); + + _$ReviewSummary._( + {this.name, + this.ratingCount, + this.averageRating, + this.responseCount, + this.recommendCount, + this.recommendRate}) + : super._(); + @override + ReviewSummary rebuild(void Function(ReviewSummaryBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + ReviewSummaryBuilder toBuilder() => ReviewSummaryBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is ReviewSummary && + name == other.name && + ratingCount == other.ratingCount && + averageRating == other.averageRating && + responseCount == other.responseCount && + recommendCount == other.recommendCount && + recommendRate == other.recommendRate; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, ratingCount.hashCode); + _$hash = $jc(_$hash, averageRating.hashCode); + _$hash = $jc(_$hash, responseCount.hashCode); + _$hash = $jc(_$hash, recommendCount.hashCode); + _$hash = $jc(_$hash, recommendRate.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'ReviewSummary') + ..add('name', name) + ..add('ratingCount', ratingCount) + ..add('averageRating', averageRating) + ..add('responseCount', responseCount) + ..add('recommendCount', recommendCount) + ..add('recommendRate', recommendRate)) + .toString(); + } +} + +class ReviewSummaryBuilder + implements Builder { + _$ReviewSummary? _$v; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + int? _ratingCount; + int? get ratingCount => _$this._ratingCount; + set ratingCount(int? ratingCount) => _$this._ratingCount = ratingCount; + + double? _averageRating; + double? get averageRating => _$this._averageRating; + set averageRating(double? averageRating) => + _$this._averageRating = averageRating; + + int? _responseCount; + int? get responseCount => _$this._responseCount; + set responseCount(int? responseCount) => + _$this._responseCount = responseCount; + + int? _recommendCount; + int? get recommendCount => _$this._recommendCount; + set recommendCount(int? recommendCount) => + _$this._recommendCount = recommendCount; + + double? _recommendRate; + double? get recommendRate => _$this._recommendRate; + set recommendRate(double? recommendRate) => + _$this._recommendRate = recommendRate; + + ReviewSummaryBuilder() { + ReviewSummary._defaults(this); + } + + ReviewSummaryBuilder get _$this { + final $v = _$v; + if ($v != null) { + _name = $v.name; + _ratingCount = $v.ratingCount; + _averageRating = $v.averageRating; + _responseCount = $v.responseCount; + _recommendCount = $v.recommendCount; + _recommendRate = $v.recommendRate; + _$v = null; + } + return this; + } + + @override + void replace(ReviewSummary other) { + _$v = other as _$ReviewSummary; + } + + @override + void update(void Function(ReviewSummaryBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + ReviewSummary build() => _build(); + + _$ReviewSummary _build() { + final _$result = _$v ?? + _$ReviewSummary._( + name: name, + ratingCount: ratingCount, + averageRating: averageRating, + responseCount: responseCount, + recommendCount: recommendCount, + recommendRate: recommendRate, + ); + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/tasting.dart b/packages/myfestival_client/lib/src/model/tasting.dart new file mode 100644 index 00000000..db07da94 --- /dev/null +++ b/packages/myfestival_client/lib/src/model/tasting.dart @@ -0,0 +1,166 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'tasting.g.dart'; + +/// A record that the caller has tried a drink at a festival. Singleton resource — one per (caller, drink). The caller is implicit in the auth context. `pours` tracks how many times the caller has had this drink at the festival (e.g. returned for a second half-pint); absent means one pour. +/// +/// Properties: +/// * [name] - Resource name: festivals/{festival}/drinks/{drink}/tasting. +/// * [pours] - How many times the caller has had this drink. Absent means one pour. Must be >= 1 when present. +/// * [createTime] - When the caller first tried this drink. +/// * [updateTime] - When this record was last updated. +@BuiltValue() +abstract class Tasting implements Built { + /// Resource name: festivals/{festival}/drinks/{drink}/tasting. + @BuiltValueField(wireName: r'name') + String? get name; + + /// How many times the caller has had this drink. Absent means one pour. Must be >= 1 when present. + @BuiltValueField(wireName: r'pours') + int? get pours; + + /// When the caller first tried this drink. + @BuiltValueField(wireName: r'createTime') + DateTime? get createTime; + + /// When this record was last updated. + @BuiltValueField(wireName: r'updateTime') + DateTime? get updateTime; + + Tasting._(); + + factory Tasting([void updates(TastingBuilder b)]) = _$Tasting; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(TastingBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$TastingSerializer(); +} + +class _$TastingSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Tasting, _$Tasting]; + + @override + final String wireName = r'Tasting'; + + Iterable _serializeProperties( + Serializers serializers, + Tasting object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + if (object.pours != null) { + yield r'pours'; + yield serializers.serialize( + object.pours, + specifiedType: const FullType(int), + ); + } + if (object.createTime != null) { + yield r'createTime'; + yield serializers.serialize( + object.createTime, + specifiedType: const FullType(DateTime), + ); + } + if (object.updateTime != null) { + yield r'updateTime'; + yield serializers.serialize( + object.updateTime, + specifiedType: const FullType(DateTime), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Tasting object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required TastingBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + case r'pours': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.pours = valueDes; + break; + case r'createTime': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(DateTime), + ) as DateTime; + result.createTime = valueDes; + break; + case r'updateTime': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(DateTime), + ) as DateTime; + result.updateTime = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Tasting deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = TastingBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/packages/myfestival_client/lib/src/model/tasting.g.dart b/packages/myfestival_client/lib/src/model/tasting.g.dart new file mode 100644 index 00000000..32200f8a --- /dev/null +++ b/packages/myfestival_client/lib/src/model/tasting.g.dart @@ -0,0 +1,124 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'tasting.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$Tasting extends Tasting { + @override + final String? name; + @override + final int? pours; + @override + final DateTime? createTime; + @override + final DateTime? updateTime; + + factory _$Tasting([void Function(TastingBuilder)? updates]) => + (TastingBuilder()..update(updates))._build(); + + _$Tasting._({this.name, this.pours, this.createTime, this.updateTime}) + : super._(); + @override + Tasting rebuild(void Function(TastingBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + TastingBuilder toBuilder() => TastingBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is Tasting && + name == other.name && + pours == other.pours && + createTime == other.createTime && + updateTime == other.updateTime; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, pours.hashCode); + _$hash = $jc(_$hash, createTime.hashCode); + _$hash = $jc(_$hash, updateTime.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'Tasting') + ..add('name', name) + ..add('pours', pours) + ..add('createTime', createTime) + ..add('updateTime', updateTime)) + .toString(); + } +} + +class TastingBuilder implements Builder { + _$Tasting? _$v; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + int? _pours; + int? get pours => _$this._pours; + set pours(int? pours) => _$this._pours = pours; + + DateTime? _createTime; + DateTime? get createTime => _$this._createTime; + set createTime(DateTime? createTime) => _$this._createTime = createTime; + + DateTime? _updateTime; + DateTime? get updateTime => _$this._updateTime; + set updateTime(DateTime? updateTime) => _$this._updateTime = updateTime; + + TastingBuilder() { + Tasting._defaults(this); + } + + TastingBuilder get _$this { + final $v = _$v; + if ($v != null) { + _name = $v.name; + _pours = $v.pours; + _createTime = $v.createTime; + _updateTime = $v.updateTime; + _$v = null; + } + return this; + } + + @override + void replace(Tasting other) { + _$v = other as _$Tasting; + } + + @override + void update(void Function(TastingBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + Tasting build() => _build(); + + _$Tasting _build() { + final _$result = _$v ?? + _$Tasting._( + name: name, + pours: pours, + createTime: createTime, + updateTime: updateTime, + ); + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/tasting_summary.dart b/packages/myfestival_client/lib/src/model/tasting_summary.dart new file mode 100644 index 00000000..ead5ab2e --- /dev/null +++ b/packages/myfestival_client/lib/src/model/tasting_summary.dart @@ -0,0 +1,147 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'tasting_summary.g.dart'; + +/// Computed, read-only aggregate of how many callers have tried a drink. Useful for social discovery (\"N people have tried this\"). Keyed by drink under the festival, matching the ReviewSummary pattern. +/// +/// Properties: +/// * [name] - Resource name: festivals/{festival}/tastingSummaries/{drink}. +/// * [tasterCount] - Number of distinct callers who have logged a tasting for this drink. +/// * [totalPours] - Total pours logged across all callers. +@BuiltValue() +abstract class TastingSummary implements Built { + /// Resource name: festivals/{festival}/tastingSummaries/{drink}. + @BuiltValueField(wireName: r'name') + String? get name; + + /// Number of distinct callers who have logged a tasting for this drink. + @BuiltValueField(wireName: r'tasterCount') + int? get tasterCount; + + /// Total pours logged across all callers. + @BuiltValueField(wireName: r'totalPours') + int? get totalPours; + + TastingSummary._(); + + factory TastingSummary([void updates(TastingSummaryBuilder b)]) = _$TastingSummary; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(TastingSummaryBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$TastingSummarySerializer(); +} + +class _$TastingSummarySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [TastingSummary, _$TastingSummary]; + + @override + final String wireName = r'TastingSummary'; + + Iterable _serializeProperties( + Serializers serializers, + TastingSummary object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + if (object.tasterCount != null) { + yield r'tasterCount'; + yield serializers.serialize( + object.tasterCount, + specifiedType: const FullType(int), + ); + } + if (object.totalPours != null) { + yield r'totalPours'; + yield serializers.serialize( + object.totalPours, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + TastingSummary object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required TastingSummaryBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + case r'tasterCount': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.tasterCount = valueDes; + break; + case r'totalPours': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.totalPours = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + TastingSummary deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = TastingSummaryBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/packages/myfestival_client/lib/src/model/tasting_summary.g.dart b/packages/myfestival_client/lib/src/model/tasting_summary.g.dart new file mode 100644 index 00000000..a58990bb --- /dev/null +++ b/packages/myfestival_client/lib/src/model/tasting_summary.g.dart @@ -0,0 +1,114 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'tasting_summary.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$TastingSummary extends TastingSummary { + @override + final String? name; + @override + final int? tasterCount; + @override + final int? totalPours; + + factory _$TastingSummary([void Function(TastingSummaryBuilder)? updates]) => + (TastingSummaryBuilder()..update(updates))._build(); + + _$TastingSummary._({this.name, this.tasterCount, this.totalPours}) + : super._(); + @override + TastingSummary rebuild(void Function(TastingSummaryBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + TastingSummaryBuilder toBuilder() => TastingSummaryBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is TastingSummary && + name == other.name && + tasterCount == other.tasterCount && + totalPours == other.totalPours; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, tasterCount.hashCode); + _$hash = $jc(_$hash, totalPours.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'TastingSummary') + ..add('name', name) + ..add('tasterCount', tasterCount) + ..add('totalPours', totalPours)) + .toString(); + } +} + +class TastingSummaryBuilder + implements Builder { + _$TastingSummary? _$v; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + int? _tasterCount; + int? get tasterCount => _$this._tasterCount; + set tasterCount(int? tasterCount) => _$this._tasterCount = tasterCount; + + int? _totalPours; + int? get totalPours => _$this._totalPours; + set totalPours(int? totalPours) => _$this._totalPours = totalPours; + + TastingSummaryBuilder() { + TastingSummary._defaults(this); + } + + TastingSummaryBuilder get _$this { + final $v = _$v; + if ($v != null) { + _name = $v.name; + _tasterCount = $v.tasterCount; + _totalPours = $v.totalPours; + _$v = null; + } + return this; + } + + @override + void replace(TastingSummary other) { + _$v = other as _$TastingSummary; + } + + @override + void update(void Function(TastingSummaryBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + TastingSummary build() => _build(); + + _$TastingSummary _build() { + final _$result = _$v ?? + _$TastingSummary._( + name: name, + tasterCount: tasterCount, + totalPours: totalPours, + ); + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/serializers.dart b/packages/myfestival_client/lib/src/serializers.dart new file mode 100644 index 00000000..84a986d8 --- /dev/null +++ b/packages/myfestival_client/lib/src/serializers.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_import + +import 'package:one_of_serializer/any_of_serializer.dart'; +import 'package:one_of_serializer/one_of_serializer.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/json_object.dart'; +import 'package:built_value/serializer.dart'; +import 'package:built_value/standard_json_plugin.dart'; +import 'package:built_value/iso_8601_date_time_serializer.dart'; +import 'package:myfestival_client/src/date_serializer.dart'; +import 'package:myfestival_client/src/model/date.dart'; + +import 'package:myfestival_client/src/model/bookmark.dart'; +import 'package:myfestival_client/src/model/list_bookmarks_response.dart'; +import 'package:myfestival_client/src/model/list_notes_response.dart'; +import 'package:myfestival_client/src/model/list_review_summaries_response.dart'; +import 'package:myfestival_client/src/model/list_reviews_response.dart'; +import 'package:myfestival_client/src/model/list_tasting_summaries_response.dart'; +import 'package:myfestival_client/src/model/list_tastings_response.dart'; +import 'package:myfestival_client/src/model/note.dart'; +import 'package:myfestival_client/src/model/review.dart'; +import 'package:myfestival_client/src/model/review_summary.dart'; +import 'package:myfestival_client/src/model/tasting.dart'; +import 'package:myfestival_client/src/model/tasting_summary.dart'; + +part 'serializers.g.dart'; + +@SerializersFor([ + Bookmark, + ListBookmarksResponse, + ListNotesResponse, + ListReviewSummariesResponse, + ListReviewsResponse, + ListTastingSummariesResponse, + ListTastingsResponse, + Note, + Review, + ReviewSummary, + Tasting, + TastingSummary, +]) +Serializers serializers = (_$serializers.toBuilder() + ..add(const OneOfSerializer()) + ..add(const AnyOfSerializer()) + ..add(const DateSerializer()) + ..add(Iso8601DateTimeSerializer()) + ).build(); + +Serializers standardSerializers = + (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); diff --git a/packages/myfestival_client/lib/src/serializers.g.dart b/packages/myfestival_client/lib/src/serializers.g.dart new file mode 100644 index 00000000..0cabfe8f --- /dev/null +++ b/packages/myfestival_client/lib/src/serializers.g.dart @@ -0,0 +1,42 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'serializers.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +Serializers _$serializers = (Serializers().toBuilder() + ..add(Bookmark.serializer) + ..add(ListBookmarksResponse.serializer) + ..add(ListNotesResponse.serializer) + ..add(ListReviewSummariesResponse.serializer) + ..add(ListReviewsResponse.serializer) + ..add(ListTastingSummariesResponse.serializer) + ..add(ListTastingsResponse.serializer) + ..add(Note.serializer) + ..add(Review.serializer) + ..add(ReviewSummary.serializer) + ..add(Tasting.serializer) + ..add(TastingSummary.serializer) + ..addBuilderFactory( + const FullType(BuiltList, const [const FullType(Bookmark)]), + () => ListBuilder()) + ..addBuilderFactory( + const FullType(BuiltList, const [const FullType(Note)]), + () => ListBuilder()) + ..addBuilderFactory( + const FullType(BuiltList, const [const FullType(Review)]), + () => ListBuilder()) + ..addBuilderFactory( + const FullType(BuiltList, const [const FullType(ReviewSummary)]), + () => ListBuilder()) + ..addBuilderFactory( + const FullType(BuiltList, const [const FullType(Tasting)]), + () => ListBuilder()) + ..addBuilderFactory( + const FullType(BuiltList, const [const FullType(TastingSummary)]), + () => ListBuilder())) + .build(); + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/pubspec.yaml b/packages/myfestival_client/pubspec.yaml new file mode 100644 index 00000000..32238175 --- /dev/null +++ b/packages/myfestival_client/pubspec.yaml @@ -0,0 +1,20 @@ +name: myfestival_client +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + + +environment: + sdk: '>=2.18.0 <4.0.0' + +dependencies: + dio: '^5.7.0' + one_of: '>=1.5.0 <2.0.0' + one_of_serializer: '>=1.5.0 <2.0.0' + built_value: '>=8.4.0 <9.0.0' + built_collection: '>=5.1.1 <6.0.0' + +dev_dependencies: + built_value_generator: '>=8.4.0 <9.0.0' + build_runner: any + test: '^1.16.0' diff --git a/packages/myfestival_client/test/bookmark_test.dart b/packages/myfestival_client/test/bookmark_test.dart new file mode 100644 index 00000000..b0728590 --- /dev/null +++ b/packages/myfestival_client/test/bookmark_test.dart @@ -0,0 +1,23 @@ +import 'package:test/test.dart'; +import 'package:myfestival_client/myfestival_client.dart'; + +// tests for Bookmark +void main() { + final instance = BookmarkBuilder(); + // TODO add properties to the builder and call build() + + group(Bookmark, () { + // Resource name: festivals/{festival}/drinks/{drink}/bookmark. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // When the bookmark was created. + // DateTime createTime + test('to test the property `createTime`', () async { + // TODO + }); + + }); +} diff --git a/packages/myfestival_client/test/list_bookmarks_response_test.dart b/packages/myfestival_client/test/list_bookmarks_response_test.dart new file mode 100644 index 00000000..1b611b5f --- /dev/null +++ b/packages/myfestival_client/test/list_bookmarks_response_test.dart @@ -0,0 +1,29 @@ +import 'package:test/test.dart'; +import 'package:myfestival_client/myfestival_client.dart'; + +// tests for ListBookmarksResponse +void main() { + final instance = ListBookmarksResponseBuilder(); + // TODO add properties to the builder and call build() + + group(ListBookmarksResponse, () { + // The caller's bookmarks for this page, one per bookmarked drink. + // BuiltList bookmarks + test('to test the property `bookmarks`', () async { + // TODO + }); + + // Token for the next page; empty when there are no more results. + // String nextPageToken + test('to test the property `nextPageToken`', () async { + // TODO + }); + + // Total number of drinks the caller has bookmarked at this festival. + // int totalSize + test('to test the property `totalSize`', () async { + // TODO + }); + + }); +} diff --git a/packages/myfestival_client/test/list_notes_response_test.dart b/packages/myfestival_client/test/list_notes_response_test.dart new file mode 100644 index 00000000..27611daf --- /dev/null +++ b/packages/myfestival_client/test/list_notes_response_test.dart @@ -0,0 +1,29 @@ +import 'package:test/test.dart'; +import 'package:myfestival_client/myfestival_client.dart'; + +// tests for ListNotesResponse +void main() { + final instance = ListNotesResponseBuilder(); + // TODO add properties to the builder and call build() + + group(ListNotesResponse, () { + // The caller's notes for this page, one per noted drink. + // BuiltList notes + test('to test the property `notes`', () async { + // TODO + }); + + // Token for the next page; empty when there are no more results. + // String nextPageToken + test('to test the property `nextPageToken`', () async { + // TODO + }); + + // Total number of drinks the caller has notes for at this festival. + // int totalSize + test('to test the property `totalSize`', () async { + // TODO + }); + + }); +} diff --git a/packages/myfestival_client/test/list_review_summaries_response_test.dart b/packages/myfestival_client/test/list_review_summaries_response_test.dart new file mode 100644 index 00000000..3b131273 --- /dev/null +++ b/packages/myfestival_client/test/list_review_summaries_response_test.dart @@ -0,0 +1,29 @@ +import 'package:test/test.dart'; +import 'package:myfestival_client/myfestival_client.dart'; + +// tests for ListReviewSummariesResponse +void main() { + final instance = ListReviewSummariesResponseBuilder(); + // TODO add properties to the builder and call build() + + group(ListReviewSummariesResponse, () { + // Aggregate review signals for this page, one per reviewed drink. + // BuiltList reviewSummaries + test('to test the property `reviewSummaries`', () async { + // TODO + }); + + // Token for the next page; empty when there are no more results. + // String nextPageToken + test('to test the property `nextPageToken`', () async { + // TODO + }); + + // Total number of drinks with at least one review at this festival. + // int totalSize + test('to test the property `totalSize`', () async { + // TODO + }); + + }); +} diff --git a/packages/myfestival_client/test/list_reviews_response_test.dart b/packages/myfestival_client/test/list_reviews_response_test.dart new file mode 100644 index 00000000..490a7fdd --- /dev/null +++ b/packages/myfestival_client/test/list_reviews_response_test.dart @@ -0,0 +1,29 @@ +import 'package:test/test.dart'; +import 'package:myfestival_client/myfestival_client.dart'; + +// tests for ListReviewsResponse +void main() { + final instance = ListReviewsResponseBuilder(); + // TODO add properties to the builder and call build() + + group(ListReviewsResponse, () { + // The caller's reviews for this page, one per reviewed drink. + // BuiltList reviews + test('to test the property `reviews`', () async { + // TODO + }); + + // Token for the next page; empty when there are no more results. + // String nextPageToken + test('to test the property `nextPageToken`', () async { + // TODO + }); + + // Total number of drinks the caller has reviewed at this festival. + // int totalSize + test('to test the property `totalSize`', () async { + // TODO + }); + + }); +} diff --git a/packages/myfestival_client/test/list_tasting_summaries_response_test.dart b/packages/myfestival_client/test/list_tasting_summaries_response_test.dart new file mode 100644 index 00000000..dd20d6ca --- /dev/null +++ b/packages/myfestival_client/test/list_tasting_summaries_response_test.dart @@ -0,0 +1,29 @@ +import 'package:test/test.dart'; +import 'package:myfestival_client/myfestival_client.dart'; + +// tests for ListTastingSummariesResponse +void main() { + final instance = ListTastingSummariesResponseBuilder(); + // TODO add properties to the builder and call build() + + group(ListTastingSummariesResponse, () { + // Tasting counts for this page, one per tried drink. + // BuiltList tastingSummaries + test('to test the property `tastingSummaries`', () async { + // TODO + }); + + // Token for the next page; empty when there are no more results. + // String nextPageToken + test('to test the property `nextPageToken`', () async { + // TODO + }); + + // Total number of drinks tried by at least one caller at this festival. + // int totalSize + test('to test the property `totalSize`', () async { + // TODO + }); + + }); +} diff --git a/packages/myfestival_client/test/list_tastings_response_test.dart b/packages/myfestival_client/test/list_tastings_response_test.dart new file mode 100644 index 00000000..668627e4 --- /dev/null +++ b/packages/myfestival_client/test/list_tastings_response_test.dart @@ -0,0 +1,29 @@ +import 'package:test/test.dart'; +import 'package:myfestival_client/myfestival_client.dart'; + +// tests for ListTastingsResponse +void main() { + final instance = ListTastingsResponseBuilder(); + // TODO add properties to the builder and call build() + + group(ListTastingsResponse, () { + // The caller's tasting records for this page, one per tried drink. + // BuiltList tastings + test('to test the property `tastings`', () async { + // TODO + }); + + // Token for the next page; empty when there are no more results. + // String nextPageToken + test('to test the property `nextPageToken`', () async { + // TODO + }); + + // Total number of drinks the caller has tried at this festival. + // int totalSize + test('to test the property `totalSize`', () async { + // TODO + }); + + }); +} diff --git a/packages/myfestival_client/test/my_festival_service_api_test.dart b/packages/myfestival_client/test/my_festival_service_api_test.dart new file mode 100644 index 00000000..3882bfee --- /dev/null +++ b/packages/myfestival_client/test/my_festival_service_api_test.dart @@ -0,0 +1,151 @@ +import 'package:test/test.dart'; +import 'package:myfestival_client/myfestival_client.dart'; + + +/// tests for MyFestivalServiceApi +void main() { + final instance = MyfestivalClient().getMyFestivalServiceApi(); + + group(MyFestivalServiceApi, () { + // Remove the caller's bookmark for a drink. + // + //Future myFestivalServiceDeleteBookmark(String festival, String drink) async + test('test myFestivalServiceDeleteBookmark', () async { + // TODO + }); + + // Remove the caller's tasting note for a drink. + // + //Future myFestivalServiceDeleteNote(String festival, String drink) async + test('test myFestivalServiceDeleteNote', () async { + // TODO + }); + + // Remove the caller's review for a drink. + // + //Future myFestivalServiceDeleteReview(String festival, String drink) async + test('test myFestivalServiceDeleteReview', () async { + // TODO + }); + + // Remove the caller's tasting record for a drink. + // + //Future myFestivalServiceDeleteTasting(String festival, String drink) async + test('test myFestivalServiceDeleteTasting', () async { + // TODO + }); + + // --- Bookmarks (caller-scoped singletons) --------------------------------- Get the caller's bookmark for a drink. + // + //Future myFestivalServiceGetBookmark(String festival, String drink) async + test('test myFestivalServiceGetBookmark', () async { + // TODO + }); + + // --- Tasting notes (caller-scoped singletons) ----------------------------- Get the caller's tasting note for a drink. + // + //Future myFestivalServiceGetNote(String festival, String drink) async + test('test myFestivalServiceGetNote', () async { + // TODO + }); + + // --- Personal reviews (caller-scoped singletons) -------------------------- Get the caller's review for a drink. + // + //Future myFestivalServiceGetReview(String festival, String drink) async + test('test myFestivalServiceGetReview', () async { + // TODO + }); + + // --- Aggregates (public, not caller-scoped) -------------------------------- Get the aggregate review signals for a single drink. + // + //Future myFestivalServiceGetReviewSummary(String festival, String reviewSummary) async + test('test myFestivalServiceGetReviewSummary', () async { + // TODO + }); + + // --- Tasting log (caller-scoped singletons) ------------------------------- Get the caller's tasting record for a drink. + // + //Future myFestivalServiceGetTasting(String festival, String drink) async + test('test myFestivalServiceGetTasting', () async { + // TODO + }); + + // Get tasting counts for a single drink. + // + //Future myFestivalServiceGetTastingSummary(String festival, String tastingSummary) async + test('test myFestivalServiceGetTastingSummary', () async { + // TODO + }); + + // List all drinks the caller has bookmarked at a festival. Intended for pre-loading \"my festival\" state on app open. + // + //Future myFestivalServiceListBookmarks(String festival, { int pageSize, String pageToken }) async + test('test myFestivalServiceListBookmarks', () async { + // TODO + }); + + // List all tasting notes the caller has written at a festival. + // + //Future myFestivalServiceListNotes(String festival, { int pageSize, String pageToken }) async + test('test myFestivalServiceListNotes', () async { + // TODO + }); + + // List aggregate review signals for every reviewed drink at a festival. + // + //Future myFestivalServiceListReviewSummaries(String festival, { int pageSize, String pageToken }) async + test('test myFestivalServiceListReviewSummaries', () async { + // TODO + }); + + // List all reviews the caller has left for drinks at a festival. Only the caller's own reviews are returned; caller identity is implicit in the auth context. Intended for pre-loading \"my festival\" state on app open. + // + //Future myFestivalServiceListReviews(String festival, { int pageSize, String pageToken }) async + test('test myFestivalServiceListReviews', () async { + // TODO + }); + + // List tasting counts for every tried drink at a festival. + // + //Future myFestivalServiceListTastingSummaries(String festival, { int pageSize, String pageToken }) async + test('test myFestivalServiceListTastingSummaries', () async { + // TODO + }); + + // List all tasting records the caller has logged at a festival. + // + //Future myFestivalServiceListTastings(String festival, { int pageSize, String pageToken }) async + test('test myFestivalServiceListTastings', () async { + // TODO + }); + + // Create or update the caller's bookmark for a drink (upsert). + // + //Future myFestivalServiceUpdateBookmark(String festival, String drink, Bookmark bookmark, { String updateMask }) async + test('test myFestivalServiceUpdateBookmark', () async { + // TODO + }); + + // Create or update the caller's tasting note for a drink (upsert). + // + //Future myFestivalServiceUpdateNote(String festival, String drink, Note note, { String updateMask }) async + test('test myFestivalServiceUpdateNote', () async { + // TODO + }); + + // Create or update the caller's review for a drink (upsert). Use `update_mask` to update a single signal (e.g. only `star_rating`) without clearing the other. + // + //Future myFestivalServiceUpdateReview(String festival, String drink, Review review, { String updateMask }) async + test('test myFestivalServiceUpdateReview', () async { + // TODO + }); + + // Create or update the caller's tasting record for a drink (upsert). Use `update_mask` with `pours` to increment the pour count without affecting other fields. + // + //Future myFestivalServiceUpdateTasting(String festival, String drink, Tasting tasting, { String updateMask }) async + test('test myFestivalServiceUpdateTasting', () async { + // TODO + }); + + }); +} diff --git a/packages/myfestival_client/test/note_test.dart b/packages/myfestival_client/test/note_test.dart new file mode 100644 index 00000000..42a37285 --- /dev/null +++ b/packages/myfestival_client/test/note_test.dart @@ -0,0 +1,29 @@ +import 'package:test/test.dart'; +import 'package:myfestival_client/myfestival_client.dart'; + +// tests for Note +void main() { + final instance = NoteBuilder(); + // TODO add properties to the builder and call build() + + group(Note, () { + // Resource name: festivals/{festival}/drinks/{drink}/note. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // The caller's note text. Max 2000 Unicode characters. + // String content + test('to test the property `content`', () async { + // TODO + }); + + // When this note was last written. + // DateTime updateTime + test('to test the property `updateTime`', () async { + // TODO + }); + + }); +} diff --git a/packages/myfestival_client/test/review_summary_test.dart b/packages/myfestival_client/test/review_summary_test.dart new file mode 100644 index 00000000..d7806d4d --- /dev/null +++ b/packages/myfestival_client/test/review_summary_test.dart @@ -0,0 +1,47 @@ +import 'package:test/test.dart'; +import 'package:myfestival_client/myfestival_client.dart'; + +// tests for ReviewSummary +void main() { + final instance = ReviewSummaryBuilder(); + // TODO add properties to the builder and call build() + + group(ReviewSummary, () { + // Resource name: festivals/{festival}/reviewSummaries/{drink}. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // Number of callers who have submitted a star rating. + // int ratingCount + test('to test the property `ratingCount`', () async { + // TODO + }); + + // Mean star rating across all callers (1.0–5.0); 0 when rating_count is 0. + // double averageRating + test('to test the property `averageRating`', () async { + // TODO + }); + + // Number of callers who have answered the \"would recommend\" question. + // int responseCount + test('to test the property `responseCount`', () async { + // TODO + }); + + // Number of callers who answered \"yes\" to the recommendation question. + // int recommendCount + test('to test the property `recommendCount`', () async { + // TODO + }); + + // Fraction of responses (0.0–1.0) that would recommend; 0 when response_count is 0. + // double recommendRate + test('to test the property `recommendRate`', () async { + // TODO + }); + + }); +} diff --git a/packages/myfestival_client/test/review_test.dart b/packages/myfestival_client/test/review_test.dart new file mode 100644 index 00000000..5c928931 --- /dev/null +++ b/packages/myfestival_client/test/review_test.dart @@ -0,0 +1,35 @@ +import 'package:test/test.dart'; +import 'package:myfestival_client/myfestival_client.dart'; + +// tests for Review +void main() { + final instance = ReviewBuilder(); + // TODO add properties to the builder and call build() + + group(Review, () { + // Resource name: festivals/{festival}/drinks/{drink}/review. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // Star rating, 1–5 inclusive. Absent if the caller has not set a star rating. + // int starRating + test('to test the property `starRating`', () async { + // TODO + }); + + // Whether the caller would recommend this drink. Absent if not answered. + // bool wouldRecommend + test('to test the property `wouldRecommend`', () async { + // TODO + }); + + // When this review was last written. + // DateTime updateTime + test('to test the property `updateTime`', () async { + // TODO + }); + + }); +} diff --git a/packages/myfestival_client/test/tasting_summary_test.dart b/packages/myfestival_client/test/tasting_summary_test.dart new file mode 100644 index 00000000..914c4e44 --- /dev/null +++ b/packages/myfestival_client/test/tasting_summary_test.dart @@ -0,0 +1,29 @@ +import 'package:test/test.dart'; +import 'package:myfestival_client/myfestival_client.dart'; + +// tests for TastingSummary +void main() { + final instance = TastingSummaryBuilder(); + // TODO add properties to the builder and call build() + + group(TastingSummary, () { + // Resource name: festivals/{festival}/tastingSummaries/{drink}. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // Number of distinct callers who have logged a tasting for this drink. + // int tasterCount + test('to test the property `tasterCount`', () async { + // TODO + }); + + // Total pours logged across all callers. + // int totalPours + test('to test the property `totalPours`', () async { + // TODO + }); + + }); +} diff --git a/packages/myfestival_client/test/tasting_test.dart b/packages/myfestival_client/test/tasting_test.dart new file mode 100644 index 00000000..9e7d6b01 --- /dev/null +++ b/packages/myfestival_client/test/tasting_test.dart @@ -0,0 +1,35 @@ +import 'package:test/test.dart'; +import 'package:myfestival_client/myfestival_client.dart'; + +// tests for Tasting +void main() { + final instance = TastingBuilder(); + // TODO add properties to the builder and call build() + + group(Tasting, () { + // Resource name: festivals/{festival}/drinks/{drink}/tasting. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // How many times the caller has had this drink. Absent means one pour. Must be >= 1 when present. + // int pours + test('to test the property `pours`', () async { + // TODO + }); + + // When the caller first tried this drink. + // DateTime createTime + test('to test the property `createTime`', () async { + // TODO + }); + + // When this record was last updated. + // DateTime updateTime + test('to test the property `updateTime`', () async { + // TODO + }); + + }); +} diff --git a/proto/cambeerfestival/myfestival/v1alpha/bookmark.proto b/proto/cambeerfestival/myfestival/v1alpha/bookmark.proto index 5020e36e..374f338e 100644 --- a/proto/cambeerfestival/myfestival/v1alpha/bookmark.proto +++ b/proto/cambeerfestival/myfestival/v1alpha/bookmark.proto @@ -3,6 +3,8 @@ syntax = "proto3"; package cambeerfestival.myfestival.v1alpha; +option go_package = "github.com/cambeerfestival/api/gen/go/cambeerfestival/myfestival/v1alpha;myfestivalv1alpha"; + import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; diff --git a/proto/cambeerfestival/myfestival/v1alpha/my_festival_service.proto b/proto/cambeerfestival/myfestival/v1alpha/my_festival_service.proto index 8b6a6e42..a04a248b 100644 --- a/proto/cambeerfestival/myfestival/v1alpha/my_festival_service.proto +++ b/proto/cambeerfestival/myfestival/v1alpha/my_festival_service.proto @@ -3,6 +3,8 @@ syntax = "proto3"; package cambeerfestival.myfestival.v1alpha; +option go_package = "github.com/cambeerfestival/api/gen/go/cambeerfestival/myfestival/v1alpha;myfestivalv1alpha"; + import "cambeerfestival/myfestival/v1alpha/bookmark.proto"; import "cambeerfestival/myfestival/v1alpha/note.proto"; import "cambeerfestival/myfestival/v1alpha/review.proto"; diff --git a/proto/cambeerfestival/myfestival/v1alpha/note.proto b/proto/cambeerfestival/myfestival/v1alpha/note.proto index b7d8f866..775cdefd 100644 --- a/proto/cambeerfestival/myfestival/v1alpha/note.proto +++ b/proto/cambeerfestival/myfestival/v1alpha/note.proto @@ -3,6 +3,8 @@ syntax = "proto3"; package cambeerfestival.myfestival.v1alpha; +option go_package = "github.com/cambeerfestival/api/gen/go/cambeerfestival/myfestival/v1alpha;myfestivalv1alpha"; + import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; diff --git a/proto/cambeerfestival/myfestival/v1alpha/review.proto b/proto/cambeerfestival/myfestival/v1alpha/review.proto index 57c1c774..1a00ef19 100644 --- a/proto/cambeerfestival/myfestival/v1alpha/review.proto +++ b/proto/cambeerfestival/myfestival/v1alpha/review.proto @@ -3,6 +3,8 @@ syntax = "proto3"; package cambeerfestival.myfestival.v1alpha; +option go_package = "github.com/cambeerfestival/api/gen/go/cambeerfestival/myfestival/v1alpha;myfestivalv1alpha"; + import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; diff --git a/proto/cambeerfestival/myfestival/v1alpha/tasting.proto b/proto/cambeerfestival/myfestival/v1alpha/tasting.proto index 739b1040..056eb71d 100644 --- a/proto/cambeerfestival/myfestival/v1alpha/tasting.proto +++ b/proto/cambeerfestival/myfestival/v1alpha/tasting.proto @@ -3,6 +3,8 @@ syntax = "proto3"; package cambeerfestival.myfestival.v1alpha; +option go_package = "github.com/cambeerfestival/api/gen/go/cambeerfestival/myfestival/v1alpha;myfestivalv1alpha"; + import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; diff --git a/pubspec.lock b/pubspec.lock index 787e8d7c..52d1069a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -217,6 +217,22 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.9" + dio: + dependency: transitive + description: + name: dio + sha256: aff32c08f92787a557dd5c0145ac91536481831a01b4648136373cddb0e64f8c + url: "https://pub.dev" + source: hosted + version: "5.9.2" + dio_web_adapter: + dependency: transitive + description: + name: dio_web_adapter + sha256: "2f9e64323a7c3c7ef69567d5c800424a11f8337b8b228bad02524c9fb3c1f340" + url: "https://pub.dev" + source: hosted + version: "2.1.2" fake_async: dependency: transitive description: @@ -567,6 +583,13 @@ packages: url: "https://pub.dev" source: hosted version: "5.7.0" + myfestival_client: + dependency: "direct main" + description: + path: "packages/myfestival_client" + relative: true + source: path + version: "1.0.0" nested: dependency: transitive description: @@ -583,6 +606,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.0" + one_of: + dependency: transitive + description: + name: one_of + sha256: "25fe0fcf181e761c6fcd604caf9d5fdf952321be17584ba81c72c06bdaa511f0" + url: "https://pub.dev" + source: hosted + version: "1.5.0" + one_of_serializer: + dependency: transitive + description: + name: one_of_serializer + sha256: "3f3dfb5c1578ba3afef1cb47fcc49e585e797af3f2b6c2cc7ed90aad0c5e7b83" + url: "https://pub.dev" + source: hosted + version: "1.5.0" package_config: dependency: transitive description: @@ -743,6 +782,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.0" + quiver: + dependency: transitive + description: + name: quiver + sha256: ea0b925899e64ecdfbf9c7becb60d5b50e706ade44a85b2363be2a22d88117d2 + url: "https://pub.dev" + source: hosted + version: "3.2.2" rxdart: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 2493856e..5a854b72 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -25,6 +25,8 @@ dependencies: collection: ^1.18.0 go_router: ^17.3.0 google_fonts: ^8.1.0 + myfestival_client: + path: packages/myfestival_client dev_dependencies: flutter_test: From d39501b378e11cd5d4ee80084ccd7b07368c7d33 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 13 Jun 2026 08:10:12 +0000 Subject: [PATCH 09/13] chore(proto): use buf managed mode for go_package instead of file options Move go_package from individual .proto files into buf.gen.yaml managed mode (go_package_prefix). buf injects the option at generation time only; the proto files stay language-neutral. https://claude.ai/code/session_01WX7GbU19M9fh3tAfAxzeET --- proto/buf.gen.yaml | 6 ++++++ proto/cambeerfestival/myfestival/v1alpha/bookmark.proto | 2 -- .../myfestival/v1alpha/my_festival_service.proto | 2 -- proto/cambeerfestival/myfestival/v1alpha/note.proto | 2 -- proto/cambeerfestival/myfestival/v1alpha/review.proto | 2 -- proto/cambeerfestival/myfestival/v1alpha/tasting.proto | 2 -- 6 files changed, 6 insertions(+), 10 deletions(-) diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml index 9f5e45f0..fb09314c 100644 --- a/proto/buf.gen.yaml +++ b/proto/buf.gen.yaml @@ -1,5 +1,11 @@ version: v2 clean: true +managed: + enabled: true + override: + # go_package injected at generation time only; not written to .proto files. + - file_option: go_package_prefix + value: github.com/cambeerfestival/api/gen/go plugins: # OpenAPI v3 generated from the google.api.http annotations, via a BSR # remote plugin (no local protoc/plugin install needed). diff --git a/proto/cambeerfestival/myfestival/v1alpha/bookmark.proto b/proto/cambeerfestival/myfestival/v1alpha/bookmark.proto index 374f338e..5020e36e 100644 --- a/proto/cambeerfestival/myfestival/v1alpha/bookmark.proto +++ b/proto/cambeerfestival/myfestival/v1alpha/bookmark.proto @@ -3,8 +3,6 @@ syntax = "proto3"; package cambeerfestival.myfestival.v1alpha; -option go_package = "github.com/cambeerfestival/api/gen/go/cambeerfestival/myfestival/v1alpha;myfestivalv1alpha"; - import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; diff --git a/proto/cambeerfestival/myfestival/v1alpha/my_festival_service.proto b/proto/cambeerfestival/myfestival/v1alpha/my_festival_service.proto index a04a248b..8b6a6e42 100644 --- a/proto/cambeerfestival/myfestival/v1alpha/my_festival_service.proto +++ b/proto/cambeerfestival/myfestival/v1alpha/my_festival_service.proto @@ -3,8 +3,6 @@ syntax = "proto3"; package cambeerfestival.myfestival.v1alpha; -option go_package = "github.com/cambeerfestival/api/gen/go/cambeerfestival/myfestival/v1alpha;myfestivalv1alpha"; - import "cambeerfestival/myfestival/v1alpha/bookmark.proto"; import "cambeerfestival/myfestival/v1alpha/note.proto"; import "cambeerfestival/myfestival/v1alpha/review.proto"; diff --git a/proto/cambeerfestival/myfestival/v1alpha/note.proto b/proto/cambeerfestival/myfestival/v1alpha/note.proto index 775cdefd..b7d8f866 100644 --- a/proto/cambeerfestival/myfestival/v1alpha/note.proto +++ b/proto/cambeerfestival/myfestival/v1alpha/note.proto @@ -3,8 +3,6 @@ syntax = "proto3"; package cambeerfestival.myfestival.v1alpha; -option go_package = "github.com/cambeerfestival/api/gen/go/cambeerfestival/myfestival/v1alpha;myfestivalv1alpha"; - import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; diff --git a/proto/cambeerfestival/myfestival/v1alpha/review.proto b/proto/cambeerfestival/myfestival/v1alpha/review.proto index 1a00ef19..57c1c774 100644 --- a/proto/cambeerfestival/myfestival/v1alpha/review.proto +++ b/proto/cambeerfestival/myfestival/v1alpha/review.proto @@ -3,8 +3,6 @@ syntax = "proto3"; package cambeerfestival.myfestival.v1alpha; -option go_package = "github.com/cambeerfestival/api/gen/go/cambeerfestival/myfestival/v1alpha;myfestivalv1alpha"; - import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; diff --git a/proto/cambeerfestival/myfestival/v1alpha/tasting.proto b/proto/cambeerfestival/myfestival/v1alpha/tasting.proto index 056eb71d..739b1040 100644 --- a/proto/cambeerfestival/myfestival/v1alpha/tasting.proto +++ b/proto/cambeerfestival/myfestival/v1alpha/tasting.proto @@ -3,8 +3,6 @@ syntax = "proto3"; package cambeerfestival.myfestival.v1alpha; -option go_package = "github.com/cambeerfestival/api/gen/go/cambeerfestival/myfestival/v1alpha;myfestivalv1alpha"; - import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; From 5e21ab5d5e32b429d889de44982639d9c4b9bd47 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 13 Jun 2026 08:16:25 +0000 Subject: [PATCH 10/13] chore(mise): move buf to dev toolchain, keep proto tasks out of CI buf was accidentally in base mise.toml, so CI would install it despite having no proto tasks to run. Moved to mise.dev.toml alongside api-linter. Both migrate to base when the API design stabilises and proto tasks enter CI. https://claude.ai/code/session_01WX7GbU19M9fh3tAfAxzeET --- mise.dev.toml | 7 +++---- mise.toml | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/mise.dev.toml b/mise.dev.toml index a3cded91..4e94ea14 100644 --- a/mise.dev.toml +++ b/mise.dev.toml @@ -16,12 +16,11 @@ [tools] watchexec = "2.5.1" +buf = "latest" # --- Protobuf / OpenAPI (API contract is proto-first; see proto/README.md) --- -# buf is provided by the base mise.toml tools. The proto tasks require network -# access to buf.build (BSR deps + remote OpenAPI plugin). -# -# api-linter lives here (dev-only) while the API design is still in flux. +# buf and api-linter live here (dev-only) while the API design is still in flux. +# Move both to base mise.toml when the API stabilises and proto tasks enter CI. # Move it to base mise.toml once the resource shapes and method signatures # have stabilised and the linter output is expected to stay clean in CI. "github:googleapis/api-linter" = "latest" diff --git a/mise.toml b/mise.toml index b721b62b..02d3fb04 100644 --- a/mise.toml +++ b/mise.toml @@ -16,7 +16,6 @@ experimental = true _.path = ["./bin"] [tools] -buf = "latest" flutter = "3.44.0" node = "22" # For http_server and Playwright e2e tests shellcheck = "0.9.0" From 0ab9124e12a5adac7909ccaa9e1b079819d9f232 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 13 Jun 2026 08:19:58 +0000 Subject: [PATCH 11/13] chore: gitignore generated packages/, remove premature pubspec dep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit packages/myfestival_client/ is a build artifact — regenerated from openapi.yaml via `proto:clients:dart`. No need to commit ~8k lines of generated Dart and lock file churn. Also removes the pubspec.yaml path dep since the app doesn't consume the client yet. Add packages/ to .gitignore. Wire it in when the client is actually used. https://claude.ai/code/session_01WX7GbU19M9fh3tAfAxzeET --- .gitignore | 7 +- packages/myfestival_client/.gitignore | 41 - .../.openapi-generator-ignore | 23 - .../.openapi-generator/FILES | 55 - .../.openapi-generator/VERSION | 1 - packages/myfestival_client/README.md | 121 -- .../myfestival_client/analysis_options.yaml | 9 - packages/myfestival_client/doc/Bookmark.md | 16 - .../doc/ListBookmarksResponse.md | 17 - .../doc/ListNotesResponse.md | 17 - .../doc/ListReviewSummariesResponse.md | 17 - .../doc/ListReviewsResponse.md | 17 - .../doc/ListTastingSummariesResponse.md | 17 - .../doc/ListTastingsResponse.md | 17 - .../doc/MyFestivalServiceApi.md | 957 ---------- packages/myfestival_client/doc/Note.md | 17 - packages/myfestival_client/doc/Review.md | 18 - .../myfestival_client/doc/ReviewSummary.md | 20 - packages/myfestival_client/doc/Tasting.md | 18 - .../myfestival_client/doc/TastingSummary.md | 17 - .../lib/myfestival_client.dart | 27 - packages/myfestival_client/lib/src/api.dart | 73 - .../lib/src/api/my_festival_service_api.dart | 1629 ----------------- .../myfestival_client/lib/src/api_util.dart | 77 - .../lib/src/auth/api_key_auth.dart | 30 - .../myfestival_client/lib/src/auth/auth.dart | 18 - .../lib/src/auth/basic_auth.dart | 37 - .../lib/src/auth/bearer_auth.dart | 26 - .../myfestival_client/lib/src/auth/oauth.dart | 26 - .../lib/src/date_serializer.dart | 31 - .../lib/src/model/bookmark.dart | 128 -- .../lib/src/model/bookmark.g.dart | 101 - .../myfestival_client/lib/src/model/date.dart | 70 - .../src/model/list_bookmarks_response.dart | 149 -- .../src/model/list_bookmarks_response.g.dart | 134 -- .../lib/src/model/list_notes_response.dart | 149 -- .../lib/src/model/list_notes_response.g.dart | 130 -- .../model/list_review_summaries_response.dart | 149 -- .../list_review_summaries_response.g.dart | 136 -- .../lib/src/model/list_reviews_response.dart | 149 -- .../src/model/list_reviews_response.g.dart | 131 -- .../list_tasting_summaries_response.dart | 149 -- .../list_tasting_summaries_response.g.dart | 136 -- .../lib/src/model/list_tastings_response.dart | 149 -- .../src/model/list_tastings_response.g.dart | 132 -- .../myfestival_client/lib/src/model/note.dart | 145 -- .../lib/src/model/note.g.dart | 113 -- .../lib/src/model/review.dart | 166 -- .../lib/src/model/review.g.dart | 125 -- .../lib/src/model/review_summary.dart | 204 --- .../lib/src/model/review_summary.g.dart | 157 -- .../lib/src/model/tasting.dart | 166 -- .../lib/src/model/tasting.g.dart | 124 -- .../lib/src/model/tasting_summary.dart | 147 -- .../lib/src/model/tasting_summary.g.dart | 114 -- .../lib/src/serializers.dart | 54 - .../lib/src/serializers.g.dart | 42 - packages/myfestival_client/pubspec.yaml | 20 - .../myfestival_client/test/bookmark_test.dart | 23 - .../test/list_bookmarks_response_test.dart | 29 - .../test/list_notes_response_test.dart | 29 - .../list_review_summaries_response_test.dart | 29 - .../test/list_reviews_response_test.dart | 29 - .../list_tasting_summaries_response_test.dart | 29 - .../test/list_tastings_response_test.dart | 29 - .../test/my_festival_service_api_test.dart | 151 -- .../myfestival_client/test/note_test.dart | 29 - .../test/review_summary_test.dart | 47 - .../myfestival_client/test/review_test.dart | 35 - .../test/tasting_summary_test.dart | 29 - .../myfestival_client/test/tasting_test.dart | 35 - pubspec.lock | 47 - pubspec.yaml | 2 - 73 files changed, 4 insertions(+), 7533 deletions(-) delete mode 100644 packages/myfestival_client/.gitignore delete mode 100644 packages/myfestival_client/.openapi-generator-ignore delete mode 100644 packages/myfestival_client/.openapi-generator/FILES delete mode 100644 packages/myfestival_client/.openapi-generator/VERSION delete mode 100644 packages/myfestival_client/README.md delete mode 100644 packages/myfestival_client/analysis_options.yaml delete mode 100644 packages/myfestival_client/doc/Bookmark.md delete mode 100644 packages/myfestival_client/doc/ListBookmarksResponse.md delete mode 100644 packages/myfestival_client/doc/ListNotesResponse.md delete mode 100644 packages/myfestival_client/doc/ListReviewSummariesResponse.md delete mode 100644 packages/myfestival_client/doc/ListReviewsResponse.md delete mode 100644 packages/myfestival_client/doc/ListTastingSummariesResponse.md delete mode 100644 packages/myfestival_client/doc/ListTastingsResponse.md delete mode 100644 packages/myfestival_client/doc/MyFestivalServiceApi.md delete mode 100644 packages/myfestival_client/doc/Note.md delete mode 100644 packages/myfestival_client/doc/Review.md delete mode 100644 packages/myfestival_client/doc/ReviewSummary.md delete mode 100644 packages/myfestival_client/doc/Tasting.md delete mode 100644 packages/myfestival_client/doc/TastingSummary.md delete mode 100644 packages/myfestival_client/lib/myfestival_client.dart delete mode 100644 packages/myfestival_client/lib/src/api.dart delete mode 100644 packages/myfestival_client/lib/src/api/my_festival_service_api.dart delete mode 100644 packages/myfestival_client/lib/src/api_util.dart delete mode 100644 packages/myfestival_client/lib/src/auth/api_key_auth.dart delete mode 100644 packages/myfestival_client/lib/src/auth/auth.dart delete mode 100644 packages/myfestival_client/lib/src/auth/basic_auth.dart delete mode 100644 packages/myfestival_client/lib/src/auth/bearer_auth.dart delete mode 100644 packages/myfestival_client/lib/src/auth/oauth.dart delete mode 100644 packages/myfestival_client/lib/src/date_serializer.dart delete mode 100644 packages/myfestival_client/lib/src/model/bookmark.dart delete mode 100644 packages/myfestival_client/lib/src/model/bookmark.g.dart delete mode 100644 packages/myfestival_client/lib/src/model/date.dart delete mode 100644 packages/myfestival_client/lib/src/model/list_bookmarks_response.dart delete mode 100644 packages/myfestival_client/lib/src/model/list_bookmarks_response.g.dart delete mode 100644 packages/myfestival_client/lib/src/model/list_notes_response.dart delete mode 100644 packages/myfestival_client/lib/src/model/list_notes_response.g.dart delete mode 100644 packages/myfestival_client/lib/src/model/list_review_summaries_response.dart delete mode 100644 packages/myfestival_client/lib/src/model/list_review_summaries_response.g.dart delete mode 100644 packages/myfestival_client/lib/src/model/list_reviews_response.dart delete mode 100644 packages/myfestival_client/lib/src/model/list_reviews_response.g.dart delete mode 100644 packages/myfestival_client/lib/src/model/list_tasting_summaries_response.dart delete mode 100644 packages/myfestival_client/lib/src/model/list_tasting_summaries_response.g.dart delete mode 100644 packages/myfestival_client/lib/src/model/list_tastings_response.dart delete mode 100644 packages/myfestival_client/lib/src/model/list_tastings_response.g.dart delete mode 100644 packages/myfestival_client/lib/src/model/note.dart delete mode 100644 packages/myfestival_client/lib/src/model/note.g.dart delete mode 100644 packages/myfestival_client/lib/src/model/review.dart delete mode 100644 packages/myfestival_client/lib/src/model/review.g.dart delete mode 100644 packages/myfestival_client/lib/src/model/review_summary.dart delete mode 100644 packages/myfestival_client/lib/src/model/review_summary.g.dart delete mode 100644 packages/myfestival_client/lib/src/model/tasting.dart delete mode 100644 packages/myfestival_client/lib/src/model/tasting.g.dart delete mode 100644 packages/myfestival_client/lib/src/model/tasting_summary.dart delete mode 100644 packages/myfestival_client/lib/src/model/tasting_summary.g.dart delete mode 100644 packages/myfestival_client/lib/src/serializers.dart delete mode 100644 packages/myfestival_client/lib/src/serializers.g.dart delete mode 100644 packages/myfestival_client/pubspec.yaml delete mode 100644 packages/myfestival_client/test/bookmark_test.dart delete mode 100644 packages/myfestival_client/test/list_bookmarks_response_test.dart delete mode 100644 packages/myfestival_client/test/list_notes_response_test.dart delete mode 100644 packages/myfestival_client/test/list_review_summaries_response_test.dart delete mode 100644 packages/myfestival_client/test/list_reviews_response_test.dart delete mode 100644 packages/myfestival_client/test/list_tasting_summaries_response_test.dart delete mode 100644 packages/myfestival_client/test/list_tastings_response_test.dart delete mode 100644 packages/myfestival_client/test/my_festival_service_api_test.dart delete mode 100644 packages/myfestival_client/test/note_test.dart delete mode 100644 packages/myfestival_client/test/review_summary_test.dart delete mode 100644 packages/myfestival_client/test/review_test.dart delete mode 100644 packages/myfestival_client/test/tasting_summary_test.dart delete mode 100644 packages/myfestival_client/test/tasting_test.dart diff --git a/.gitignore b/.gitignore index 4bf5246b..2f5c1f5e 100644 --- a/.gitignore +++ b/.gitignore @@ -41,12 +41,13 @@ build/ !mise-tasks/build/ flutter_*.png -# Generated files (build_runner) — excluded for main app, but committed for generated packages +# Generated files (build_runner) *.g.dart *.freezed.dart *.mocks.dart -# Allow .g.dart inside generated packages (they must be committed alongside their source) -!packages/**/*.g.dart + +# Generated client packages (regenerated from OpenAPI via proto:clients tasks) +packages/ # Android related **/android/**/gradle-wrapper.jar diff --git a/packages/myfestival_client/.gitignore b/packages/myfestival_client/.gitignore deleted file mode 100644 index 4298cdcb..00000000 --- a/packages/myfestival_client/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ -# See https://dart.dev/guides/libraries/private-files - -# Files and directories created by pub -.dart_tool/ -.buildlog -.packages -.project -.pub/ -build/ -**/packages/ - -# Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these -# rules if you intend to use dart2js directly -# Convention is to use extension '.dart.js' for Dart compiled to Javascript to -# differentiate from explicit Javascript files) -*.dart.js -*.part.js -*.js.deps -*.js.map -*.info.json - -# Directory created by dartdoc -doc/api/ - -# Don't commit pubspec lock file -# (Library packages only! Remove pattern if developing an application package) -pubspec.lock - -# Don’t commit files and directories created by other development environments. -# For example, if your development environment creates any of the following files, -# consider putting them in a global ignore file: - -# IntelliJ -*.iml -*.ipr -*.iws -.idea/ - -# Mac -.DS_Store diff --git a/packages/myfestival_client/.openapi-generator-ignore b/packages/myfestival_client/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/packages/myfestival_client/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/packages/myfestival_client/.openapi-generator/FILES b/packages/myfestival_client/.openapi-generator/FILES deleted file mode 100644 index 008d7281..00000000 --- a/packages/myfestival_client/.openapi-generator/FILES +++ /dev/null @@ -1,55 +0,0 @@ -.gitignore -.openapi-generator-ignore -README.md -analysis_options.yaml -doc/Bookmark.md -doc/ListBookmarksResponse.md -doc/ListNotesResponse.md -doc/ListReviewSummariesResponse.md -doc/ListReviewsResponse.md -doc/ListTastingSummariesResponse.md -doc/ListTastingsResponse.md -doc/MyFestivalServiceApi.md -doc/Note.md -doc/Review.md -doc/ReviewSummary.md -doc/Tasting.md -doc/TastingSummary.md -lib/myfestival_client.dart -lib/src/api.dart -lib/src/api/my_festival_service_api.dart -lib/src/api_util.dart -lib/src/auth/api_key_auth.dart -lib/src/auth/auth.dart -lib/src/auth/basic_auth.dart -lib/src/auth/bearer_auth.dart -lib/src/auth/oauth.dart -lib/src/date_serializer.dart -lib/src/model/bookmark.dart -lib/src/model/date.dart -lib/src/model/list_bookmarks_response.dart -lib/src/model/list_notes_response.dart -lib/src/model/list_review_summaries_response.dart -lib/src/model/list_reviews_response.dart -lib/src/model/list_tasting_summaries_response.dart -lib/src/model/list_tastings_response.dart -lib/src/model/note.dart -lib/src/model/review.dart -lib/src/model/review_summary.dart -lib/src/model/tasting.dart -lib/src/model/tasting_summary.dart -lib/src/serializers.dart -pubspec.yaml -test/bookmark_test.dart -test/list_bookmarks_response_test.dart -test/list_notes_response_test.dart -test/list_review_summaries_response_test.dart -test/list_reviews_response_test.dart -test/list_tasting_summaries_response_test.dart -test/list_tastings_response_test.dart -test/my_festival_service_api_test.dart -test/note_test.dart -test/review_summary_test.dart -test/review_test.dart -test/tasting_summary_test.dart -test/tasting_test.dart diff --git a/packages/myfestival_client/.openapi-generator/VERSION b/packages/myfestival_client/.openapi-generator/VERSION deleted file mode 100644 index eb1dc6a5..00000000 --- a/packages/myfestival_client/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.13.0 diff --git a/packages/myfestival_client/README.md b/packages/myfestival_client/README.md deleted file mode 100644 index c11dc925..00000000 --- a/packages/myfestival_client/README.md +++ /dev/null @@ -1,121 +0,0 @@ -# myfestival_client (EXPERIMENTAL) -Stores each caller's personal festival state (bookmarks, notes, tastings, - reviews) and serves back bucket-scoped aggregates. Writes are local-first on - the client; this service holds the shared, cross-device state. - - All personal resources are singleton resources — one per (caller, drink). - The caller's identity is resolved from the auth context; it never appears in - resource names, keeping device IDs private and making the sign-in upgrade - transparent to existing clients. - -This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 0.0.1 -- Generator version: 7.13.0 -- Build package: org.openapitools.codegen.languages.DartDioClientCodegen - -## Requirements - -* Dart 2.15.0+ or Flutter 2.8.0+ -* Dio 5.0.0+ (https://pub.dev/packages/dio) - -## Installation & Usage - -### pub.dev -To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml -```yaml -dependencies: - myfestival_client: 1.0.0 -``` - -### Github -If this Dart package is published to Github, please include the following in pubspec.yaml -```yaml -dependencies: - myfestival_client: - git: - url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git - #ref: main -``` - -### Local development -To use the package from your local drive, please include the following in pubspec.yaml -```yaml -dependencies: - myfestival_client: - path: /path/to/myfestival_client -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```dart -import 'package:myfestival_client/myfestival_client.dart'; - - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final String drink = drink_example; // String | The drink id. - -try { - api.myFestivalServiceDeleteBookmark(festival, drink); -} catch on DioException (e) { - print("Exception when calling MyFestivalServiceApi->myFestivalServiceDeleteBookmark: $e\n"); -} - -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://api.cambeerfestival.app* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceDeleteBookmark**](doc/MyFestivalServiceApi.md#myfestivalservicedeletebookmark) | **DELETE** /v1alpha/festivals/{festival}/drinks/{drink}/bookmark | -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceDeleteNote**](doc/MyFestivalServiceApi.md#myfestivalservicedeletenote) | **DELETE** /v1alpha/festivals/{festival}/drinks/{drink}/note | -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceDeleteReview**](doc/MyFestivalServiceApi.md#myfestivalservicedeletereview) | **DELETE** /v1alpha/festivals/{festival}/drinks/{drink}/review | -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceDeleteTasting**](doc/MyFestivalServiceApi.md#myfestivalservicedeletetasting) | **DELETE** /v1alpha/festivals/{festival}/drinks/{drink}/tasting | -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceGetBookmark**](doc/MyFestivalServiceApi.md#myfestivalservicegetbookmark) | **GET** /v1alpha/festivals/{festival}/drinks/{drink}/bookmark | -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceGetNote**](doc/MyFestivalServiceApi.md#myfestivalservicegetnote) | **GET** /v1alpha/festivals/{festival}/drinks/{drink}/note | -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceGetReview**](doc/MyFestivalServiceApi.md#myfestivalservicegetreview) | **GET** /v1alpha/festivals/{festival}/drinks/{drink}/review | -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceGetReviewSummary**](doc/MyFestivalServiceApi.md#myfestivalservicegetreviewsummary) | **GET** /v1alpha/festivals/{festival}/reviewSummaries/{reviewSummary} | -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceGetTasting**](doc/MyFestivalServiceApi.md#myfestivalservicegettasting) | **GET** /v1alpha/festivals/{festival}/drinks/{drink}/tasting | -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceGetTastingSummary**](doc/MyFestivalServiceApi.md#myfestivalservicegettastingsummary) | **GET** /v1alpha/festivals/{festival}/tastingSummaries/{tastingSummary} | -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceListBookmarks**](doc/MyFestivalServiceApi.md#myfestivalservicelistbookmarks) | **GET** /v1alpha/festivals/{festival}/bookmarks | -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceListNotes**](doc/MyFestivalServiceApi.md#myfestivalservicelistnotes) | **GET** /v1alpha/festivals/{festival}/notes | -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceListReviewSummaries**](doc/MyFestivalServiceApi.md#myfestivalservicelistreviewsummaries) | **GET** /v1alpha/festivals/{festival}/reviewSummaries | -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceListReviews**](doc/MyFestivalServiceApi.md#myfestivalservicelistreviews) | **GET** /v1alpha/festivals/{festival}/reviews | -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceListTastingSummaries**](doc/MyFestivalServiceApi.md#myfestivalservicelisttastingsummaries) | **GET** /v1alpha/festivals/{festival}/tastingSummaries | -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceListTastings**](doc/MyFestivalServiceApi.md#myfestivalservicelisttastings) | **GET** /v1alpha/festivals/{festival}/tastings | -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceUpdateBookmark**](doc/MyFestivalServiceApi.md#myfestivalserviceupdatebookmark) | **PATCH** /v1alpha/festivals/{festival}/drinks/{drink}/bookmark | -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceUpdateNote**](doc/MyFestivalServiceApi.md#myfestivalserviceupdatenote) | **PATCH** /v1alpha/festivals/{festival}/drinks/{drink}/note | -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceUpdateReview**](doc/MyFestivalServiceApi.md#myfestivalserviceupdatereview) | **PATCH** /v1alpha/festivals/{festival}/drinks/{drink}/review | -[*MyFestivalServiceApi*](doc/MyFestivalServiceApi.md) | [**myFestivalServiceUpdateTasting**](doc/MyFestivalServiceApi.md#myfestivalserviceupdatetasting) | **PATCH** /v1alpha/festivals/{festival}/drinks/{drink}/tasting | - - -## Documentation For Models - - - [Bookmark](doc/Bookmark.md) - - [ListBookmarksResponse](doc/ListBookmarksResponse.md) - - [ListNotesResponse](doc/ListNotesResponse.md) - - [ListReviewSummariesResponse](doc/ListReviewSummariesResponse.md) - - [ListReviewsResponse](doc/ListReviewsResponse.md) - - [ListTastingSummariesResponse](doc/ListTastingSummariesResponse.md) - - [ListTastingsResponse](doc/ListTastingsResponse.md) - - [Note](doc/Note.md) - - [Review](doc/Review.md) - - [ReviewSummary](doc/ReviewSummary.md) - - [Tasting](doc/Tasting.md) - - [TastingSummary](doc/TastingSummary.md) - - -## Documentation For Authorization - -Endpoints do not require authorization. - - -## Author - - - diff --git a/packages/myfestival_client/analysis_options.yaml b/packages/myfestival_client/analysis_options.yaml deleted file mode 100644 index 16a95850..00000000 --- a/packages/myfestival_client/analysis_options.yaml +++ /dev/null @@ -1,9 +0,0 @@ -analyzer: - language: - strict-inference: true - strict-raw-types: true - strict-casts: false - exclude: - - test/*.dart - errors: - deprecated_member_use_from_same_package: ignore diff --git a/packages/myfestival_client/doc/Bookmark.md b/packages/myfestival_client/doc/Bookmark.md deleted file mode 100644 index 884886c6..00000000 --- a/packages/myfestival_client/doc/Bookmark.md +++ /dev/null @@ -1,16 +0,0 @@ -# myfestival_client.model.Bookmark - -## Load the model package -```dart -import 'package:myfestival_client/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Resource name: festivals/{festival}/drinks/{drink}/bookmark. | [optional] -**createTime** | [**DateTime**](DateTime.md) | When the bookmark was created. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/packages/myfestival_client/doc/ListBookmarksResponse.md b/packages/myfestival_client/doc/ListBookmarksResponse.md deleted file mode 100644 index c53f0766..00000000 --- a/packages/myfestival_client/doc/ListBookmarksResponse.md +++ /dev/null @@ -1,17 +0,0 @@ -# myfestival_client.model.ListBookmarksResponse - -## Load the model package -```dart -import 'package:myfestival_client/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bookmarks** | [**BuiltList<Bookmark>**](Bookmark.md) | The caller's bookmarks for this page, one per bookmarked drink. | [optional] -**nextPageToken** | **String** | Token for the next page; empty when there are no more results. | [optional] -**totalSize** | **int** | Total number of drinks the caller has bookmarked at this festival. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/packages/myfestival_client/doc/ListNotesResponse.md b/packages/myfestival_client/doc/ListNotesResponse.md deleted file mode 100644 index d7150d63..00000000 --- a/packages/myfestival_client/doc/ListNotesResponse.md +++ /dev/null @@ -1,17 +0,0 @@ -# myfestival_client.model.ListNotesResponse - -## Load the model package -```dart -import 'package:myfestival_client/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**notes** | [**BuiltList<Note>**](Note.md) | The caller's notes for this page, one per noted drink. | [optional] -**nextPageToken** | **String** | Token for the next page; empty when there are no more results. | [optional] -**totalSize** | **int** | Total number of drinks the caller has notes for at this festival. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/packages/myfestival_client/doc/ListReviewSummariesResponse.md b/packages/myfestival_client/doc/ListReviewSummariesResponse.md deleted file mode 100644 index c97593c5..00000000 --- a/packages/myfestival_client/doc/ListReviewSummariesResponse.md +++ /dev/null @@ -1,17 +0,0 @@ -# myfestival_client.model.ListReviewSummariesResponse - -## Load the model package -```dart -import 'package:myfestival_client/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**reviewSummaries** | [**BuiltList<ReviewSummary>**](ReviewSummary.md) | Aggregate review signals for this page, one per reviewed drink. | [optional] -**nextPageToken** | **String** | Token for the next page; empty when there are no more results. | [optional] -**totalSize** | **int** | Total number of drinks with at least one review at this festival. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/packages/myfestival_client/doc/ListReviewsResponse.md b/packages/myfestival_client/doc/ListReviewsResponse.md deleted file mode 100644 index 96dfb3c2..00000000 --- a/packages/myfestival_client/doc/ListReviewsResponse.md +++ /dev/null @@ -1,17 +0,0 @@ -# myfestival_client.model.ListReviewsResponse - -## Load the model package -```dart -import 'package:myfestival_client/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**reviews** | [**BuiltList<Review>**](Review.md) | The caller's reviews for this page, one per reviewed drink. | [optional] -**nextPageToken** | **String** | Token for the next page; empty when there are no more results. | [optional] -**totalSize** | **int** | Total number of drinks the caller has reviewed at this festival. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/packages/myfestival_client/doc/ListTastingSummariesResponse.md b/packages/myfestival_client/doc/ListTastingSummariesResponse.md deleted file mode 100644 index 69b2ffc7..00000000 --- a/packages/myfestival_client/doc/ListTastingSummariesResponse.md +++ /dev/null @@ -1,17 +0,0 @@ -# myfestival_client.model.ListTastingSummariesResponse - -## Load the model package -```dart -import 'package:myfestival_client/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tastingSummaries** | [**BuiltList<TastingSummary>**](TastingSummary.md) | Tasting counts for this page, one per tried drink. | [optional] -**nextPageToken** | **String** | Token for the next page; empty when there are no more results. | [optional] -**totalSize** | **int** | Total number of drinks tried by at least one caller at this festival. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/packages/myfestival_client/doc/ListTastingsResponse.md b/packages/myfestival_client/doc/ListTastingsResponse.md deleted file mode 100644 index 6a78d985..00000000 --- a/packages/myfestival_client/doc/ListTastingsResponse.md +++ /dev/null @@ -1,17 +0,0 @@ -# myfestival_client.model.ListTastingsResponse - -## Load the model package -```dart -import 'package:myfestival_client/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tastings** | [**BuiltList<Tasting>**](Tasting.md) | The caller's tasting records for this page, one per tried drink. | [optional] -**nextPageToken** | **String** | Token for the next page; empty when there are no more results. | [optional] -**totalSize** | **int** | Total number of drinks the caller has tried at this festival. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/packages/myfestival_client/doc/MyFestivalServiceApi.md b/packages/myfestival_client/doc/MyFestivalServiceApi.md deleted file mode 100644 index 0a57ac56..00000000 --- a/packages/myfestival_client/doc/MyFestivalServiceApi.md +++ /dev/null @@ -1,957 +0,0 @@ -# myfestival_client.api.MyFestivalServiceApi - -## Load the API package -```dart -import 'package:myfestival_client/api.dart'; -``` - -All URIs are relative to *https://api.cambeerfestival.app* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**myFestivalServiceDeleteBookmark**](MyFestivalServiceApi.md#myfestivalservicedeletebookmark) | **DELETE** /v1alpha/festivals/{festival}/drinks/{drink}/bookmark | -[**myFestivalServiceDeleteNote**](MyFestivalServiceApi.md#myfestivalservicedeletenote) | **DELETE** /v1alpha/festivals/{festival}/drinks/{drink}/note | -[**myFestivalServiceDeleteReview**](MyFestivalServiceApi.md#myfestivalservicedeletereview) | **DELETE** /v1alpha/festivals/{festival}/drinks/{drink}/review | -[**myFestivalServiceDeleteTasting**](MyFestivalServiceApi.md#myfestivalservicedeletetasting) | **DELETE** /v1alpha/festivals/{festival}/drinks/{drink}/tasting | -[**myFestivalServiceGetBookmark**](MyFestivalServiceApi.md#myfestivalservicegetbookmark) | **GET** /v1alpha/festivals/{festival}/drinks/{drink}/bookmark | -[**myFestivalServiceGetNote**](MyFestivalServiceApi.md#myfestivalservicegetnote) | **GET** /v1alpha/festivals/{festival}/drinks/{drink}/note | -[**myFestivalServiceGetReview**](MyFestivalServiceApi.md#myfestivalservicegetreview) | **GET** /v1alpha/festivals/{festival}/drinks/{drink}/review | -[**myFestivalServiceGetReviewSummary**](MyFestivalServiceApi.md#myfestivalservicegetreviewsummary) | **GET** /v1alpha/festivals/{festival}/reviewSummaries/{reviewSummary} | -[**myFestivalServiceGetTasting**](MyFestivalServiceApi.md#myfestivalservicegettasting) | **GET** /v1alpha/festivals/{festival}/drinks/{drink}/tasting | -[**myFestivalServiceGetTastingSummary**](MyFestivalServiceApi.md#myfestivalservicegettastingsummary) | **GET** /v1alpha/festivals/{festival}/tastingSummaries/{tastingSummary} | -[**myFestivalServiceListBookmarks**](MyFestivalServiceApi.md#myfestivalservicelistbookmarks) | **GET** /v1alpha/festivals/{festival}/bookmarks | -[**myFestivalServiceListNotes**](MyFestivalServiceApi.md#myfestivalservicelistnotes) | **GET** /v1alpha/festivals/{festival}/notes | -[**myFestivalServiceListReviewSummaries**](MyFestivalServiceApi.md#myfestivalservicelistreviewsummaries) | **GET** /v1alpha/festivals/{festival}/reviewSummaries | -[**myFestivalServiceListReviews**](MyFestivalServiceApi.md#myfestivalservicelistreviews) | **GET** /v1alpha/festivals/{festival}/reviews | -[**myFestivalServiceListTastingSummaries**](MyFestivalServiceApi.md#myfestivalservicelisttastingsummaries) | **GET** /v1alpha/festivals/{festival}/tastingSummaries | -[**myFestivalServiceListTastings**](MyFestivalServiceApi.md#myfestivalservicelisttastings) | **GET** /v1alpha/festivals/{festival}/tastings | -[**myFestivalServiceUpdateBookmark**](MyFestivalServiceApi.md#myfestivalserviceupdatebookmark) | **PATCH** /v1alpha/festivals/{festival}/drinks/{drink}/bookmark | -[**myFestivalServiceUpdateNote**](MyFestivalServiceApi.md#myfestivalserviceupdatenote) | **PATCH** /v1alpha/festivals/{festival}/drinks/{drink}/note | -[**myFestivalServiceUpdateReview**](MyFestivalServiceApi.md#myfestivalserviceupdatereview) | **PATCH** /v1alpha/festivals/{festival}/drinks/{drink}/review | -[**myFestivalServiceUpdateTasting**](MyFestivalServiceApi.md#myfestivalserviceupdatetasting) | **PATCH** /v1alpha/festivals/{festival}/drinks/{drink}/tasting | - - -# **myFestivalServiceDeleteBookmark** -> myFestivalServiceDeleteBookmark(festival, drink) - - - -Remove the caller's bookmark for a drink. - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final String drink = drink_example; // String | The drink id. - -try { - api.myFestivalServiceDeleteBookmark(festival, drink); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceDeleteBookmark: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **drink** | **String**| The drink id. | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **myFestivalServiceDeleteNote** -> myFestivalServiceDeleteNote(festival, drink) - - - -Remove the caller's tasting note for a drink. - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final String drink = drink_example; // String | The drink id. - -try { - api.myFestivalServiceDeleteNote(festival, drink); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceDeleteNote: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **drink** | **String**| The drink id. | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **myFestivalServiceDeleteReview** -> myFestivalServiceDeleteReview(festival, drink) - - - -Remove the caller's review for a drink. - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final String drink = drink_example; // String | The drink id. - -try { - api.myFestivalServiceDeleteReview(festival, drink); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceDeleteReview: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **drink** | **String**| The drink id. | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **myFestivalServiceDeleteTasting** -> myFestivalServiceDeleteTasting(festival, drink) - - - -Remove the caller's tasting record for a drink. - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final String drink = drink_example; // String | The drink id. - -try { - api.myFestivalServiceDeleteTasting(festival, drink); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceDeleteTasting: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **drink** | **String**| The drink id. | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **myFestivalServiceGetBookmark** -> Bookmark myFestivalServiceGetBookmark(festival, drink) - - - ---- Bookmarks (caller-scoped singletons) --------------------------------- Get the caller's bookmark for a drink. - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final String drink = drink_example; // String | The drink id. - -try { - final response = api.myFestivalServiceGetBookmark(festival, drink); - print(response); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceGetBookmark: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **drink** | **String**| The drink id. | - -### Return type - -[**Bookmark**](Bookmark.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **myFestivalServiceGetNote** -> Note myFestivalServiceGetNote(festival, drink) - - - ---- Tasting notes (caller-scoped singletons) ----------------------------- Get the caller's tasting note for a drink. - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final String drink = drink_example; // String | The drink id. - -try { - final response = api.myFestivalServiceGetNote(festival, drink); - print(response); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceGetNote: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **drink** | **String**| The drink id. | - -### Return type - -[**Note**](Note.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **myFestivalServiceGetReview** -> Review myFestivalServiceGetReview(festival, drink) - - - ---- Personal reviews (caller-scoped singletons) -------------------------- Get the caller's review for a drink. - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final String drink = drink_example; // String | The drink id. - -try { - final response = api.myFestivalServiceGetReview(festival, drink); - print(response); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceGetReview: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **drink** | **String**| The drink id. | - -### Return type - -[**Review**](Review.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **myFestivalServiceGetReviewSummary** -> ReviewSummary myFestivalServiceGetReviewSummary(festival, reviewSummary) - - - ---- Aggregates (public, not caller-scoped) -------------------------------- Get the aggregate review signals for a single drink. - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final String reviewSummary = reviewSummary_example; // String | The reviewSummary id. - -try { - final response = api.myFestivalServiceGetReviewSummary(festival, reviewSummary); - print(response); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceGetReviewSummary: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **reviewSummary** | **String**| The reviewSummary id. | - -### Return type - -[**ReviewSummary**](ReviewSummary.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **myFestivalServiceGetTasting** -> Tasting myFestivalServiceGetTasting(festival, drink) - - - ---- Tasting log (caller-scoped singletons) ------------------------------- Get the caller's tasting record for a drink. - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final String drink = drink_example; // String | The drink id. - -try { - final response = api.myFestivalServiceGetTasting(festival, drink); - print(response); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceGetTasting: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **drink** | **String**| The drink id. | - -### Return type - -[**Tasting**](Tasting.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **myFestivalServiceGetTastingSummary** -> TastingSummary myFestivalServiceGetTastingSummary(festival, tastingSummary) - - - -Get tasting counts for a single drink. - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final String tastingSummary = tastingSummary_example; // String | The tastingSummary id. - -try { - final response = api.myFestivalServiceGetTastingSummary(festival, tastingSummary); - print(response); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceGetTastingSummary: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **tastingSummary** | **String**| The tastingSummary id. | - -### Return type - -[**TastingSummary**](TastingSummary.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **myFestivalServiceListBookmarks** -> ListBookmarksResponse myFestivalServiceListBookmarks(festival, pageSize, pageToken) - - - -List all drinks the caller has bookmarked at a festival. Intended for pre-loading \"my festival\" state on app open. - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final int pageSize = 56; // int | Maximum number of bookmarks to return. The server default returns all of the caller's bookmarks for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. -final String pageToken = pageToken_example; // String | Page token from a previous ListBookmarks response. - -try { - final response = api.myFestivalServiceListBookmarks(festival, pageSize, pageToken); - print(response); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceListBookmarks: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **pageSize** | **int**| Maximum number of bookmarks to return. The server default returns all of the caller's bookmarks for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. | [optional] - **pageToken** | **String**| Page token from a previous ListBookmarks response. | [optional] - -### Return type - -[**ListBookmarksResponse**](ListBookmarksResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **myFestivalServiceListNotes** -> ListNotesResponse myFestivalServiceListNotes(festival, pageSize, pageToken) - - - -List all tasting notes the caller has written at a festival. - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final int pageSize = 56; // int | Maximum number of notes to return. The server default returns all of the caller's notes for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. -final String pageToken = pageToken_example; // String | Page token from a previous ListNotes response. - -try { - final response = api.myFestivalServiceListNotes(festival, pageSize, pageToken); - print(response); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceListNotes: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **pageSize** | **int**| Maximum number of notes to return. The server default returns all of the caller's notes for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. | [optional] - **pageToken** | **String**| Page token from a previous ListNotes response. | [optional] - -### Return type - -[**ListNotesResponse**](ListNotesResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **myFestivalServiceListReviewSummaries** -> ListReviewSummariesResponse myFestivalServiceListReviewSummaries(festival, pageSize, pageToken) - - - -List aggregate review signals for every reviewed drink at a festival. - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final int pageSize = 56; // int | Maximum number of summaries to return. The server default returns all summaries for the festival in a single page (drink counts are bounded). Set explicitly to paginate. -final String pageToken = pageToken_example; // String | Page token from a previous ListReviewSummaries response. - -try { - final response = api.myFestivalServiceListReviewSummaries(festival, pageSize, pageToken); - print(response); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceListReviewSummaries: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **pageSize** | **int**| Maximum number of summaries to return. The server default returns all summaries for the festival in a single page (drink counts are bounded). Set explicitly to paginate. | [optional] - **pageToken** | **String**| Page token from a previous ListReviewSummaries response. | [optional] - -### Return type - -[**ListReviewSummariesResponse**](ListReviewSummariesResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **myFestivalServiceListReviews** -> ListReviewsResponse myFestivalServiceListReviews(festival, pageSize, pageToken) - - - -List all reviews the caller has left for drinks at a festival. Only the caller's own reviews are returned; caller identity is implicit in the auth context. Intended for pre-loading \"my festival\" state on app open. - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final int pageSize = 56; // int | Maximum number of reviews to return. The server default returns all of the caller's reviews for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. -final String pageToken = pageToken_example; // String | Page token from a previous ListReviews response. - -try { - final response = api.myFestivalServiceListReviews(festival, pageSize, pageToken); - print(response); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceListReviews: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **pageSize** | **int**| Maximum number of reviews to return. The server default returns all of the caller's reviews for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. | [optional] - **pageToken** | **String**| Page token from a previous ListReviews response. | [optional] - -### Return type - -[**ListReviewsResponse**](ListReviewsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **myFestivalServiceListTastingSummaries** -> ListTastingSummariesResponse myFestivalServiceListTastingSummaries(festival, pageSize, pageToken) - - - -List tasting counts for every tried drink at a festival. - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final int pageSize = 56; // int | Maximum number of summaries to return. The server default returns all summaries for the festival in a single page (drink counts are bounded). Set explicitly to paginate. -final String pageToken = pageToken_example; // String | Page token from a previous ListTastingSummaries response. - -try { - final response = api.myFestivalServiceListTastingSummaries(festival, pageSize, pageToken); - print(response); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceListTastingSummaries: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **pageSize** | **int**| Maximum number of summaries to return. The server default returns all summaries for the festival in a single page (drink counts are bounded). Set explicitly to paginate. | [optional] - **pageToken** | **String**| Page token from a previous ListTastingSummaries response. | [optional] - -### Return type - -[**ListTastingSummariesResponse**](ListTastingSummariesResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **myFestivalServiceListTastings** -> ListTastingsResponse myFestivalServiceListTastings(festival, pageSize, pageToken) - - - -List all tasting records the caller has logged at a festival. - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final int pageSize = 56; // int | Maximum number of tastings to return. The server default returns all of the caller's tastings for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. -final String pageToken = pageToken_example; // String | Page token from a previous ListTastings response. - -try { - final response = api.myFestivalServiceListTastings(festival, pageSize, pageToken); - print(response); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceListTastings: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **pageSize** | **int**| Maximum number of tastings to return. The server default returns all of the caller's tastings for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. | [optional] - **pageToken** | **String**| Page token from a previous ListTastings response. | [optional] - -### Return type - -[**ListTastingsResponse**](ListTastingsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **myFestivalServiceUpdateBookmark** -> Bookmark myFestivalServiceUpdateBookmark(festival, drink, bookmark, updateMask) - - - -Create or update the caller's bookmark for a drink (upsert). - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final String drink = drink_example; // String | The drink id. -final Bookmark bookmark = ; // Bookmark | -final String updateMask = updateMask_example; // String | Fields to update. Omit to replace all writable fields. - -try { - final response = api.myFestivalServiceUpdateBookmark(festival, drink, bookmark, updateMask); - print(response); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceUpdateBookmark: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **drink** | **String**| The drink id. | - **bookmark** | [**Bookmark**](Bookmark.md)| | - **updateMask** | **String**| Fields to update. Omit to replace all writable fields. | [optional] - -### Return type - -[**Bookmark**](Bookmark.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **myFestivalServiceUpdateNote** -> Note myFestivalServiceUpdateNote(festival, drink, note, updateMask) - - - -Create or update the caller's tasting note for a drink (upsert). - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final String drink = drink_example; // String | The drink id. -final Note note = ; // Note | -final String updateMask = updateMask_example; // String | Fields to update. Omit to replace all writable fields. - -try { - final response = api.myFestivalServiceUpdateNote(festival, drink, note, updateMask); - print(response); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceUpdateNote: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **drink** | **String**| The drink id. | - **note** | [**Note**](Note.md)| | - **updateMask** | **String**| Fields to update. Omit to replace all writable fields. | [optional] - -### Return type - -[**Note**](Note.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **myFestivalServiceUpdateReview** -> Review myFestivalServiceUpdateReview(festival, drink, review, updateMask) - - - -Create or update the caller's review for a drink (upsert). Use `update_mask` to update a single signal (e.g. only `star_rating`) without clearing the other. - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final String drink = drink_example; // String | The drink id. -final Review review = ; // Review | -final String updateMask = updateMask_example; // String | Fields to update. Omit to replace all writable fields. Specify `star_rating` or `would_recommend` individually to update one signal without affecting the other. - -try { - final response = api.myFestivalServiceUpdateReview(festival, drink, review, updateMask); - print(response); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceUpdateReview: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **drink** | **String**| The drink id. | - **review** | [**Review**](Review.md)| | - **updateMask** | **String**| Fields to update. Omit to replace all writable fields. Specify `star_rating` or `would_recommend` individually to update one signal without affecting the other. | [optional] - -### Return type - -[**Review**](Review.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **myFestivalServiceUpdateTasting** -> Tasting myFestivalServiceUpdateTasting(festival, drink, tasting, updateMask) - - - -Create or update the caller's tasting record for a drink (upsert). Use `update_mask` with `pours` to increment the pour count without affecting other fields. - -### Example -```dart -import 'package:myfestival_client/api.dart'; - -final api = MyfestivalClient().getMyFestivalServiceApi(); -final String festival = festival_example; // String | The festival id. -final String drink = drink_example; // String | The drink id. -final Tasting tasting = ; // Tasting | -final String updateMask = updateMask_example; // String | Fields to update. Omit to replace all writable fields. Specify `pours` to update the pour count without affecting other fields. - -try { - final response = api.myFestivalServiceUpdateTasting(festival, drink, tasting, updateMask); - print(response); -} catch on DioException (e) { - print('Exception when calling MyFestivalServiceApi->myFestivalServiceUpdateTasting: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **festival** | **String**| The festival id. | - **drink** | **String**| The drink id. | - **tasting** | [**Tasting**](Tasting.md)| | - **updateMask** | **String**| Fields to update. Omit to replace all writable fields. Specify `pours` to update the pour count without affecting other fields. | [optional] - -### Return type - -[**Tasting**](Tasting.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/packages/myfestival_client/doc/Note.md b/packages/myfestival_client/doc/Note.md deleted file mode 100644 index d1681b05..00000000 --- a/packages/myfestival_client/doc/Note.md +++ /dev/null @@ -1,17 +0,0 @@ -# myfestival_client.model.Note - -## Load the model package -```dart -import 'package:myfestival_client/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Resource name: festivals/{festival}/drinks/{drink}/note. | [optional] -**content** | **String** | The caller's note text. Max 2000 Unicode characters. | -**updateTime** | [**DateTime**](DateTime.md) | When this note was last written. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/packages/myfestival_client/doc/Review.md b/packages/myfestival_client/doc/Review.md deleted file mode 100644 index 3cf18dec..00000000 --- a/packages/myfestival_client/doc/Review.md +++ /dev/null @@ -1,18 +0,0 @@ -# myfestival_client.model.Review - -## Load the model package -```dart -import 'package:myfestival_client/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Resource name: festivals/{festival}/drinks/{drink}/review. | [optional] -**starRating** | **int** | Star rating, 1–5 inclusive. Absent if the caller has not set a star rating. | [optional] -**wouldRecommend** | **bool** | Whether the caller would recommend this drink. Absent if not answered. | [optional] -**updateTime** | [**DateTime**](DateTime.md) | When this review was last written. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/packages/myfestival_client/doc/ReviewSummary.md b/packages/myfestival_client/doc/ReviewSummary.md deleted file mode 100644 index 3986c2f4..00000000 --- a/packages/myfestival_client/doc/ReviewSummary.md +++ /dev/null @@ -1,20 +0,0 @@ -# myfestival_client.model.ReviewSummary - -## Load the model package -```dart -import 'package:myfestival_client/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Resource name: festivals/{festival}/reviewSummaries/{drink}. | [optional] -**ratingCount** | **int** | Number of callers who have submitted a star rating. | [optional] -**averageRating** | **double** | Mean star rating across all callers (1.0–5.0); 0 when rating_count is 0. | [optional] -**responseCount** | **int** | Number of callers who have answered the \"would recommend\" question. | [optional] -**recommendCount** | **int** | Number of callers who answered \"yes\" to the recommendation question. | [optional] -**recommendRate** | **double** | Fraction of responses (0.0–1.0) that would recommend; 0 when response_count is 0. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/packages/myfestival_client/doc/Tasting.md b/packages/myfestival_client/doc/Tasting.md deleted file mode 100644 index febb2b2c..00000000 --- a/packages/myfestival_client/doc/Tasting.md +++ /dev/null @@ -1,18 +0,0 @@ -# myfestival_client.model.Tasting - -## Load the model package -```dart -import 'package:myfestival_client/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Resource name: festivals/{festival}/drinks/{drink}/tasting. | [optional] -**pours** | **int** | How many times the caller has had this drink. Absent means one pour. Must be >= 1 when present. | [optional] -**createTime** | [**DateTime**](DateTime.md) | When the caller first tried this drink. | [optional] -**updateTime** | [**DateTime**](DateTime.md) | When this record was last updated. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/packages/myfestival_client/doc/TastingSummary.md b/packages/myfestival_client/doc/TastingSummary.md deleted file mode 100644 index d1da1c4d..00000000 --- a/packages/myfestival_client/doc/TastingSummary.md +++ /dev/null @@ -1,17 +0,0 @@ -# myfestival_client.model.TastingSummary - -## Load the model package -```dart -import 'package:myfestival_client/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Resource name: festivals/{festival}/tastingSummaries/{drink}. | [optional] -**tasterCount** | **int** | Number of distinct callers who have logged a tasting for this drink. | [optional] -**totalPours** | **int** | Total pours logged across all callers. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/packages/myfestival_client/lib/myfestival_client.dart b/packages/myfestival_client/lib/myfestival_client.dart deleted file mode 100644 index 5dff89f2..00000000 --- a/packages/myfestival_client/lib/myfestival_client.dart +++ /dev/null @@ -1,27 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -export 'package:myfestival_client/src/api.dart'; -export 'package:myfestival_client/src/auth/api_key_auth.dart'; -export 'package:myfestival_client/src/auth/basic_auth.dart'; -export 'package:myfestival_client/src/auth/bearer_auth.dart'; -export 'package:myfestival_client/src/auth/oauth.dart'; -export 'package:myfestival_client/src/serializers.dart'; -export 'package:myfestival_client/src/model/date.dart'; - -export 'package:myfestival_client/src/api/my_festival_service_api.dart'; - -export 'package:myfestival_client/src/model/bookmark.dart'; -export 'package:myfestival_client/src/model/list_bookmarks_response.dart'; -export 'package:myfestival_client/src/model/list_notes_response.dart'; -export 'package:myfestival_client/src/model/list_review_summaries_response.dart'; -export 'package:myfestival_client/src/model/list_reviews_response.dart'; -export 'package:myfestival_client/src/model/list_tasting_summaries_response.dart'; -export 'package:myfestival_client/src/model/list_tastings_response.dart'; -export 'package:myfestival_client/src/model/note.dart'; -export 'package:myfestival_client/src/model/review.dart'; -export 'package:myfestival_client/src/model/review_summary.dart'; -export 'package:myfestival_client/src/model/tasting.dart'; -export 'package:myfestival_client/src/model/tasting_summary.dart'; - diff --git a/packages/myfestival_client/lib/src/api.dart b/packages/myfestival_client/lib/src/api.dart deleted file mode 100644 index e399883c..00000000 --- a/packages/myfestival_client/lib/src/api.dart +++ /dev/null @@ -1,73 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; -import 'package:built_value/serializer.dart'; -import 'package:myfestival_client/src/serializers.dart'; -import 'package:myfestival_client/src/auth/api_key_auth.dart'; -import 'package:myfestival_client/src/auth/basic_auth.dart'; -import 'package:myfestival_client/src/auth/bearer_auth.dart'; -import 'package:myfestival_client/src/auth/oauth.dart'; -import 'package:myfestival_client/src/api/my_festival_service_api.dart'; - -class MyfestivalClient { - static const String basePath = r'https://api.cambeerfestival.app'; - - final Dio dio; - final Serializers serializers; - - MyfestivalClient({ - Dio? dio, - Serializers? serializers, - String? basePathOverride, - List? interceptors, - }) : this.serializers = serializers ?? standardSerializers, - this.dio = dio ?? - Dio(BaseOptions( - baseUrl: basePathOverride ?? basePath, - connectTimeout: const Duration(milliseconds: 5000), - receiveTimeout: const Duration(milliseconds: 3000), - )) { - if (interceptors == null) { - this.dio.interceptors.addAll([ - OAuthInterceptor(), - BasicAuthInterceptor(), - BearerAuthInterceptor(), - ApiKeyAuthInterceptor(), - ]); - } else { - this.dio.interceptors.addAll(interceptors); - } - } - - void setOAuthToken(String name, String token) { - if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; - } - } - - void setBearerAuth(String name, String token) { - if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; - } - } - - void setBasicAuth(String name, String username, String password) { - if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); - } - } - - void setApiKey(String name, String apiKey) { - if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { - (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; - } - } - - /// Get MyFestivalServiceApi instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - MyFestivalServiceApi getMyFestivalServiceApi() { - return MyFestivalServiceApi(dio, serializers); - } -} diff --git a/packages/myfestival_client/lib/src/api/my_festival_service_api.dart b/packages/myfestival_client/lib/src/api/my_festival_service_api.dart deleted file mode 100644 index 61d8e847..00000000 --- a/packages/myfestival_client/lib/src/api/my_festival_service_api.dart +++ /dev/null @@ -1,1629 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'package:built_value/json_object.dart'; -import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; - -import 'package:myfestival_client/src/api_util.dart'; -import 'package:myfestival_client/src/model/bookmark.dart'; -import 'package:myfestival_client/src/model/list_bookmarks_response.dart'; -import 'package:myfestival_client/src/model/list_notes_response.dart'; -import 'package:myfestival_client/src/model/list_review_summaries_response.dart'; -import 'package:myfestival_client/src/model/list_reviews_response.dart'; -import 'package:myfestival_client/src/model/list_tasting_summaries_response.dart'; -import 'package:myfestival_client/src/model/list_tastings_response.dart'; -import 'package:myfestival_client/src/model/note.dart'; -import 'package:myfestival_client/src/model/review.dart'; -import 'package:myfestival_client/src/model/review_summary.dart'; -import 'package:myfestival_client/src/model/tasting.dart'; -import 'package:myfestival_client/src/model/tasting_summary.dart'; - -class MyFestivalServiceApi { - - final Dio _dio; - - final Serializers _serializers; - - const MyFestivalServiceApi(this._dio, this._serializers); - - /// myFestivalServiceDeleteBookmark - /// Remove the caller's bookmark for a drink. - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [drink] - The drink id. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceDeleteBookmark({ - required String festival, - required String drink, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/bookmark'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); - final _options = Options( - method: r'DELETE', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// myFestivalServiceDeleteNote - /// Remove the caller's tasting note for a drink. - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [drink] - The drink id. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceDeleteNote({ - required String festival, - required String drink, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/note'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); - final _options = Options( - method: r'DELETE', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// myFestivalServiceDeleteReview - /// Remove the caller's review for a drink. - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [drink] - The drink id. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceDeleteReview({ - required String festival, - required String drink, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/review'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); - final _options = Options( - method: r'DELETE', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// myFestivalServiceDeleteTasting - /// Remove the caller's tasting record for a drink. - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [drink] - The drink id. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceDeleteTasting({ - required String festival, - required String drink, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/tasting'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); - final _options = Options( - method: r'DELETE', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// myFestivalServiceGetBookmark - /// --- Bookmarks (caller-scoped singletons) --------------------------------- Get the caller's bookmark for a drink. - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [drink] - The drink id. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Bookmark] as data - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceGetBookmark({ - required String festival, - required String drink, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/bookmark'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Bookmark? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(Bookmark), - ) as Bookmark; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// myFestivalServiceGetNote - /// --- Tasting notes (caller-scoped singletons) ----------------------------- Get the caller's tasting note for a drink. - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [drink] - The drink id. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Note] as data - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceGetNote({ - required String festival, - required String drink, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/note'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Note? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(Note), - ) as Note; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// myFestivalServiceGetReview - /// --- Personal reviews (caller-scoped singletons) -------------------------- Get the caller's review for a drink. - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [drink] - The drink id. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Review] as data - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceGetReview({ - required String festival, - required String drink, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/review'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Review? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(Review), - ) as Review; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// myFestivalServiceGetReviewSummary - /// --- Aggregates (public, not caller-scoped) -------------------------------- Get the aggregate review signals for a single drink. - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [reviewSummary] - The reviewSummary id. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ReviewSummary] as data - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceGetReviewSummary({ - required String festival, - required String reviewSummary, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/reviewSummaries/{reviewSummary}'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'reviewSummary' '}', encodeQueryParameter(_serializers, reviewSummary, const FullType(String)).toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ReviewSummary? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(ReviewSummary), - ) as ReviewSummary; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// myFestivalServiceGetTasting - /// --- Tasting log (caller-scoped singletons) ------------------------------- Get the caller's tasting record for a drink. - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [drink] - The drink id. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Tasting] as data - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceGetTasting({ - required String festival, - required String drink, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/tasting'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Tasting? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(Tasting), - ) as Tasting; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// myFestivalServiceGetTastingSummary - /// Get tasting counts for a single drink. - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [tastingSummary] - The tastingSummary id. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [TastingSummary] as data - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceGetTastingSummary({ - required String festival, - required String tastingSummary, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/tastingSummaries/{tastingSummary}'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'tastingSummary' '}', encodeQueryParameter(_serializers, tastingSummary, const FullType(String)).toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - TastingSummary? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(TastingSummary), - ) as TastingSummary; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// myFestivalServiceListBookmarks - /// List all drinks the caller has bookmarked at a festival. Intended for pre-loading \"my festival\" state on app open. - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [pageSize] - Maximum number of bookmarks to return. The server default returns all of the caller's bookmarks for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. - /// * [pageToken] - Page token from a previous ListBookmarks response. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ListBookmarksResponse] as data - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceListBookmarks({ - required String festival, - int? pageSize, - String? pageToken, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/bookmarks'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (pageSize != null) r'pageSize': encodeQueryParameter(_serializers, pageSize, const FullType(int)), - if (pageToken != null) r'pageToken': encodeQueryParameter(_serializers, pageToken, const FullType(String)), - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ListBookmarksResponse? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(ListBookmarksResponse), - ) as ListBookmarksResponse; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// myFestivalServiceListNotes - /// List all tasting notes the caller has written at a festival. - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [pageSize] - Maximum number of notes to return. The server default returns all of the caller's notes for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. - /// * [pageToken] - Page token from a previous ListNotes response. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ListNotesResponse] as data - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceListNotes({ - required String festival, - int? pageSize, - String? pageToken, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/notes'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (pageSize != null) r'pageSize': encodeQueryParameter(_serializers, pageSize, const FullType(int)), - if (pageToken != null) r'pageToken': encodeQueryParameter(_serializers, pageToken, const FullType(String)), - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ListNotesResponse? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(ListNotesResponse), - ) as ListNotesResponse; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// myFestivalServiceListReviewSummaries - /// List aggregate review signals for every reviewed drink at a festival. - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [pageSize] - Maximum number of summaries to return. The server default returns all summaries for the festival in a single page (drink counts are bounded). Set explicitly to paginate. - /// * [pageToken] - Page token from a previous ListReviewSummaries response. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ListReviewSummariesResponse] as data - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceListReviewSummaries({ - required String festival, - int? pageSize, - String? pageToken, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/reviewSummaries'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (pageSize != null) r'pageSize': encodeQueryParameter(_serializers, pageSize, const FullType(int)), - if (pageToken != null) r'pageToken': encodeQueryParameter(_serializers, pageToken, const FullType(String)), - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ListReviewSummariesResponse? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(ListReviewSummariesResponse), - ) as ListReviewSummariesResponse; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// myFestivalServiceListReviews - /// List all reviews the caller has left for drinks at a festival. Only the caller's own reviews are returned; caller identity is implicit in the auth context. Intended for pre-loading \"my festival\" state on app open. - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [pageSize] - Maximum number of reviews to return. The server default returns all of the caller's reviews for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. - /// * [pageToken] - Page token from a previous ListReviews response. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ListReviewsResponse] as data - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceListReviews({ - required String festival, - int? pageSize, - String? pageToken, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/reviews'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (pageSize != null) r'pageSize': encodeQueryParameter(_serializers, pageSize, const FullType(int)), - if (pageToken != null) r'pageToken': encodeQueryParameter(_serializers, pageToken, const FullType(String)), - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ListReviewsResponse? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(ListReviewsResponse), - ) as ListReviewsResponse; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// myFestivalServiceListTastingSummaries - /// List tasting counts for every tried drink at a festival. - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [pageSize] - Maximum number of summaries to return. The server default returns all summaries for the festival in a single page (drink counts are bounded). Set explicitly to paginate. - /// * [pageToken] - Page token from a previous ListTastingSummaries response. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ListTastingSummariesResponse] as data - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceListTastingSummaries({ - required String festival, - int? pageSize, - String? pageToken, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/tastingSummaries'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (pageSize != null) r'pageSize': encodeQueryParameter(_serializers, pageSize, const FullType(int)), - if (pageToken != null) r'pageToken': encodeQueryParameter(_serializers, pageToken, const FullType(String)), - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ListTastingSummariesResponse? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(ListTastingSummariesResponse), - ) as ListTastingSummariesResponse; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// myFestivalServiceListTastings - /// List all tasting records the caller has logged at a festival. - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [pageSize] - Maximum number of tastings to return. The server default returns all of the caller's tastings for the festival in a single page (festival drink counts are bounded). Set explicitly to paginate. - /// * [pageToken] - Page token from a previous ListTastings response. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ListTastingsResponse] as data - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceListTastings({ - required String festival, - int? pageSize, - String? pageToken, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/tastings'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (pageSize != null) r'pageSize': encodeQueryParameter(_serializers, pageSize, const FullType(int)), - if (pageToken != null) r'pageToken': encodeQueryParameter(_serializers, pageToken, const FullType(String)), - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ListTastingsResponse? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(ListTastingsResponse), - ) as ListTastingsResponse; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// myFestivalServiceUpdateBookmark - /// Create or update the caller's bookmark for a drink (upsert). - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [drink] - The drink id. - /// * [bookmark] - /// * [updateMask] - Fields to update. Omit to replace all writable fields. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Bookmark] as data - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceUpdateBookmark({ - required String festival, - required String drink, - required Bookmark bookmark, - String? updateMask, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/bookmark'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); - final _options = Options( - method: r'PATCH', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (updateMask != null) r'updateMask': encodeQueryParameter(_serializers, updateMask, const FullType(String)), - }; - - dynamic _bodyData; - - try { - const _type = FullType(Bookmark); - _bodyData = _serializers.serialize(bookmark, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Bookmark? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(Bookmark), - ) as Bookmark; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// myFestivalServiceUpdateNote - /// Create or update the caller's tasting note for a drink (upsert). - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [drink] - The drink id. - /// * [note] - /// * [updateMask] - Fields to update. Omit to replace all writable fields. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Note] as data - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceUpdateNote({ - required String festival, - required String drink, - required Note note, - String? updateMask, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/note'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); - final _options = Options( - method: r'PATCH', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (updateMask != null) r'updateMask': encodeQueryParameter(_serializers, updateMask, const FullType(String)), - }; - - dynamic _bodyData; - - try { - const _type = FullType(Note); - _bodyData = _serializers.serialize(note, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Note? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(Note), - ) as Note; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// myFestivalServiceUpdateReview - /// Create or update the caller's review for a drink (upsert). Use `update_mask` to update a single signal (e.g. only `star_rating`) without clearing the other. - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [drink] - The drink id. - /// * [review] - /// * [updateMask] - Fields to update. Omit to replace all writable fields. Specify `star_rating` or `would_recommend` individually to update one signal without affecting the other. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Review] as data - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceUpdateReview({ - required String festival, - required String drink, - required Review review, - String? updateMask, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/review'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); - final _options = Options( - method: r'PATCH', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (updateMask != null) r'updateMask': encodeQueryParameter(_serializers, updateMask, const FullType(String)), - }; - - dynamic _bodyData; - - try { - const _type = FullType(Review); - _bodyData = _serializers.serialize(review, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Review? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(Review), - ) as Review; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// myFestivalServiceUpdateTasting - /// Create or update the caller's tasting record for a drink (upsert). Use `update_mask` with `pours` to increment the pour count without affecting other fields. - /// - /// Parameters: - /// * [festival] - The festival id. - /// * [drink] - The drink id. - /// * [tasting] - /// * [updateMask] - Fields to update. Omit to replace all writable fields. Specify `pours` to update the pour count without affecting other fields. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Tasting] as data - /// Throws [DioException] if API call or serialization fails - Future> myFestivalServiceUpdateTasting({ - required String festival, - required String drink, - required Tasting tasting, - String? updateMask, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/v1alpha/festivals/{festival}/drinks/{drink}/tasting'.replaceAll('{' r'festival' '}', encodeQueryParameter(_serializers, festival, const FullType(String)).toString()).replaceAll('{' r'drink' '}', encodeQueryParameter(_serializers, drink, const FullType(String)).toString()); - final _options = Options( - method: r'PATCH', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (updateMask != null) r'updateMask': encodeQueryParameter(_serializers, updateMask, const FullType(String)), - }; - - dynamic _bodyData; - - try { - const _type = FullType(Tasting); - _bodyData = _serializers.serialize(tasting, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Tasting? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(Tasting), - ) as Tasting; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/packages/myfestival_client/lib/src/api_util.dart b/packages/myfestival_client/lib/src/api_util.dart deleted file mode 100644 index ed3bb12f..00000000 --- a/packages/myfestival_client/lib/src/api_util.dart +++ /dev/null @@ -1,77 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:convert'; -import 'dart:typed_data'; - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; - -/// Format the given form parameter object into something that Dio can handle. -/// Returns primitive or String. -/// Returns List/Map if the value is BuildList/BuiltMap. -dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized is String) { - return serialized; - } - if (value is BuiltList || value is BuiltSet || value is BuiltMap) { - return serialized; - } - return json.encode(serialized); -} - -dynamic encodeQueryParameter( - Serializers serializers, - dynamic value, - FullType type, -) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - if (value is Uint8List) { - // Currently not sure how to serialize this - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized == null) { - return ''; - } - if (serialized is String) { - return serialized; - } - return serialized; -} - -ListParam encodeCollectionQueryParameter( - Serializers serializers, - dynamic value, - FullType type, { - ListFormat format = ListFormat.multi, -}) { - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (value is BuiltList || value is BuiltSet) { - return ListParam(List.of((serialized as Iterable).cast()), format); - } - throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); -} diff --git a/packages/myfestival_client/lib/src/auth/api_key_auth.dart b/packages/myfestival_client/lib/src/auth/api_key_auth.dart deleted file mode 100644 index f7bc151a..00000000 --- a/packages/myfestival_client/lib/src/auth/api_key_auth.dart +++ /dev/null @@ -1,30 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - - -import 'package:dio/dio.dart'; -import 'package:myfestival_client/src/auth/auth.dart'; - -class ApiKeyAuthInterceptor extends AuthInterceptor { - final Map apiKeys = {}; - - @override - void onRequest(RequestOptions options, RequestInterceptorHandler handler) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); - for (final info in authInfo) { - final authName = info['name'] as String; - final authKeyName = info['keyName'] as String; - final authWhere = info['where'] as String; - final apiKey = apiKeys[authName]; - if (apiKey != null) { - if (authWhere == 'query') { - options.queryParameters[authKeyName] = apiKey; - } else { - options.headers[authKeyName] = apiKey; - } - } - } - super.onRequest(options, handler); - } -} diff --git a/packages/myfestival_client/lib/src/auth/auth.dart b/packages/myfestival_client/lib/src/auth/auth.dart deleted file mode 100644 index f7ae9bf3..00000000 --- a/packages/myfestival_client/lib/src/auth/auth.dart +++ /dev/null @@ -1,18 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; - -abstract class AuthInterceptor extends Interceptor { - /// Get auth information on given route for the given type. - /// Can return an empty list if type is not present on auth data or - /// if route doesn't need authentication. - List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) { - if (route.extra.containsKey('secure')) { - final auth = route.extra['secure'] as List>; - return auth.where((secure) => handles(secure)).toList(); - } - return []; - } -} diff --git a/packages/myfestival_client/lib/src/auth/basic_auth.dart b/packages/myfestival_client/lib/src/auth/basic_auth.dart deleted file mode 100644 index fd421745..00000000 --- a/packages/myfestival_client/lib/src/auth/basic_auth.dart +++ /dev/null @@ -1,37 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:convert'; - -import 'package:dio/dio.dart'; -import 'package:myfestival_client/src/auth/auth.dart'; - -class BasicAuthInfo { - final String username; - final String password; - - const BasicAuthInfo(this.username, this.password); -} - -class BasicAuthInterceptor extends AuthInterceptor { - final Map authInfo = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme']?.toLowerCase() == 'basic') || secure['type'] == 'basic'); - for (final info in metadataAuthInfo) { - final authName = info['name'] as String; - final basicAuthInfo = authInfo[authName]; - if (basicAuthInfo != null) { - final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; - options.headers['Authorization'] = basicAuth; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/packages/myfestival_client/lib/src/auth/bearer_auth.dart b/packages/myfestival_client/lib/src/auth/bearer_auth.dart deleted file mode 100644 index 0434e6de..00000000 --- a/packages/myfestival_client/lib/src/auth/bearer_auth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; -import 'package:myfestival_client/src/auth/auth.dart'; - -class BearerAuthInterceptor extends AuthInterceptor { - final Map tokens = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme']?.toLowerCase() == 'bearer'); - for (final info in authInfo) { - final token = tokens[info['name']]; - if (token != null) { - options.headers['Authorization'] = 'Bearer ${token}'; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/packages/myfestival_client/lib/src/auth/oauth.dart b/packages/myfestival_client/lib/src/auth/oauth.dart deleted file mode 100644 index 9371002b..00000000 --- a/packages/myfestival_client/lib/src/auth/oauth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; -import 'package:myfestival_client/src/auth/auth.dart'; - -class OAuthInterceptor extends AuthInterceptor { - final Map tokens = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); - for (final info in authInfo) { - final token = tokens[info['name']]; - if (token != null) { - options.headers['Authorization'] = 'Bearer ${token}'; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/packages/myfestival_client/lib/src/date_serializer.dart b/packages/myfestival_client/lib/src/date_serializer.dart deleted file mode 100644 index 1f405f19..00000000 --- a/packages/myfestival_client/lib/src/date_serializer.dart +++ /dev/null @@ -1,31 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:myfestival_client/src/model/date.dart'; - -class DateSerializer implements PrimitiveSerializer { - - const DateSerializer(); - - @override - Iterable get types => BuiltList.of([Date]); - - @override - String get wireName => 'Date'; - - @override - Date deserialize(Serializers serializers, Object serialized, - {FullType specifiedType = FullType.unspecified}) { - final parsed = DateTime.parse(serialized as String); - return Date(parsed.year, parsed.month, parsed.day); - } - - @override - Object serialize(Serializers serializers, Date date, - {FullType specifiedType = FullType.unspecified}) { - return date.toString(); - } -} diff --git a/packages/myfestival_client/lib/src/model/bookmark.dart b/packages/myfestival_client/lib/src/model/bookmark.dart deleted file mode 100644 index ecf0c8fd..00000000 --- a/packages/myfestival_client/lib/src/model/bookmark.dart +++ /dev/null @@ -1,128 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'bookmark.g.dart'; - -/// A drink the caller has bookmarked at a festival. Singleton resource — one per (caller, drink). The resource's mere existence means the drink is bookmarked; deleting it removes the bookmark. The caller is implicit in the auth context. -/// -/// Properties: -/// * [name] - Resource name: festivals/{festival}/drinks/{drink}/bookmark. -/// * [createTime] - When the bookmark was created. -@BuiltValue() -abstract class Bookmark implements Built { - /// Resource name: festivals/{festival}/drinks/{drink}/bookmark. - @BuiltValueField(wireName: r'name') - String? get name; - - /// When the bookmark was created. - @BuiltValueField(wireName: r'createTime') - DateTime? get createTime; - - Bookmark._(); - - factory Bookmark([void updates(BookmarkBuilder b)]) = _$Bookmark; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(BookmarkBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$BookmarkSerializer(); -} - -class _$BookmarkSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [Bookmark, _$Bookmark]; - - @override - final String wireName = r'Bookmark'; - - Iterable _serializeProperties( - Serializers serializers, - Bookmark object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); - } - if (object.createTime != null) { - yield r'createTime'; - yield serializers.serialize( - object.createTime, - specifiedType: const FullType(DateTime), - ); - } - } - - @override - Object serialize( - Serializers serializers, - Bookmark object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required BookmarkBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'name': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.name = valueDes; - break; - case r'createTime': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(DateTime), - ) as DateTime; - result.createTime = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - Bookmark deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = BookmarkBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/packages/myfestival_client/lib/src/model/bookmark.g.dart b/packages/myfestival_client/lib/src/model/bookmark.g.dart deleted file mode 100644 index 4e9a44ba..00000000 --- a/packages/myfestival_client/lib/src/model/bookmark.g.dart +++ /dev/null @@ -1,101 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'bookmark.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -class _$Bookmark extends Bookmark { - @override - final String? name; - @override - final DateTime? createTime; - - factory _$Bookmark([void Function(BookmarkBuilder)? updates]) => - (BookmarkBuilder()..update(updates))._build(); - - _$Bookmark._({this.name, this.createTime}) : super._(); - @override - Bookmark rebuild(void Function(BookmarkBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - BookmarkBuilder toBuilder() => BookmarkBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is Bookmark && - name == other.name && - createTime == other.createTime; - } - - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, name.hashCode); - _$hash = $jc(_$hash, createTime.hashCode); - _$hash = $jf(_$hash); - return _$hash; - } - - @override - String toString() { - return (newBuiltValueToStringHelper(r'Bookmark') - ..add('name', name) - ..add('createTime', createTime)) - .toString(); - } -} - -class BookmarkBuilder implements Builder { - _$Bookmark? _$v; - - String? _name; - String? get name => _$this._name; - set name(String? name) => _$this._name = name; - - DateTime? _createTime; - DateTime? get createTime => _$this._createTime; - set createTime(DateTime? createTime) => _$this._createTime = createTime; - - BookmarkBuilder() { - Bookmark._defaults(this); - } - - BookmarkBuilder get _$this { - final $v = _$v; - if ($v != null) { - _name = $v.name; - _createTime = $v.createTime; - _$v = null; - } - return this; - } - - @override - void replace(Bookmark other) { - _$v = other as _$Bookmark; - } - - @override - void update(void Function(BookmarkBuilder)? updates) { - if (updates != null) updates(this); - } - - @override - Bookmark build() => _build(); - - _$Bookmark _build() { - final _$result = _$v ?? - _$Bookmark._( - name: name, - createTime: createTime, - ); - replace(_$result); - return _$result; - } -} - -// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/date.dart b/packages/myfestival_client/lib/src/model/date.dart deleted file mode 100644 index b21c7f54..00000000 --- a/packages/myfestival_client/lib/src/model/date.dart +++ /dev/null @@ -1,70 +0,0 @@ -/// A gregorian calendar date generated by -/// OpenAPI generator to differentiate -/// between [DateTime] and [Date] formats. -class Date implements Comparable { - final int year; - - /// January is 1. - final int month; - - /// First day is 1. - final int day; - - Date(this.year, this.month, this.day); - - /// The current date - static Date now({bool utc = false}) { - var now = DateTime.now(); - if (utc) { - now = now.toUtc(); - } - return now.toDate(); - } - - /// Convert to a [DateTime]. - DateTime toDateTime({bool utc = false}) { - if (utc) { - return DateTime.utc(year, month, day); - } else { - return DateTime(year, month, day); - } - } - - @override - int compareTo(Date other) { - int d = year.compareTo(other.year); - if (d != 0) { - return d; - } - d = month.compareTo(other.month); - if (d != 0) { - return d; - } - return day.compareTo(other.day); - } - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Date && - runtimeType == other.runtimeType && - year == other.year && - month == other.month && - day == other.day; - - @override - int get hashCode => year.hashCode ^ month.hashCode ^ day.hashCode; - - @override - String toString() { - final yyyy = year.toString(); - final mm = month.toString().padLeft(2, '0'); - final dd = day.toString().padLeft(2, '0'); - - return '$yyyy-$mm-$dd'; - } -} - -extension DateTimeToDate on DateTime { - Date toDate() => Date(year, month, day); -} diff --git a/packages/myfestival_client/lib/src/model/list_bookmarks_response.dart b/packages/myfestival_client/lib/src/model/list_bookmarks_response.dart deleted file mode 100644 index fadb46a3..00000000 --- a/packages/myfestival_client/lib/src/model/list_bookmarks_response.dart +++ /dev/null @@ -1,149 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:myfestival_client/src/model/bookmark.dart'; -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'list_bookmarks_response.g.dart'; - -/// Response message for ListBookmarks. -/// -/// Properties: -/// * [bookmarks] - The caller's bookmarks for this page, one per bookmarked drink. -/// * [nextPageToken] - Token for the next page; empty when there are no more results. -/// * [totalSize] - Total number of drinks the caller has bookmarked at this festival. -@BuiltValue() -abstract class ListBookmarksResponse implements Built { - /// The caller's bookmarks for this page, one per bookmarked drink. - @BuiltValueField(wireName: r'bookmarks') - BuiltList? get bookmarks; - - /// Token for the next page; empty when there are no more results. - @BuiltValueField(wireName: r'nextPageToken') - String? get nextPageToken; - - /// Total number of drinks the caller has bookmarked at this festival. - @BuiltValueField(wireName: r'totalSize') - int? get totalSize; - - ListBookmarksResponse._(); - - factory ListBookmarksResponse([void updates(ListBookmarksResponseBuilder b)]) = _$ListBookmarksResponse; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ListBookmarksResponseBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ListBookmarksResponseSerializer(); -} - -class _$ListBookmarksResponseSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [ListBookmarksResponse, _$ListBookmarksResponse]; - - @override - final String wireName = r'ListBookmarksResponse'; - - Iterable _serializeProperties( - Serializers serializers, - ListBookmarksResponse object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.bookmarks != null) { - yield r'bookmarks'; - yield serializers.serialize( - object.bookmarks, - specifiedType: const FullType(BuiltList, [FullType(Bookmark)]), - ); - } - if (object.nextPageToken != null) { - yield r'nextPageToken'; - yield serializers.serialize( - object.nextPageToken, - specifiedType: const FullType(String), - ); - } - if (object.totalSize != null) { - yield r'totalSize'; - yield serializers.serialize( - object.totalSize, - specifiedType: const FullType(int), - ); - } - } - - @override - Object serialize( - Serializers serializers, - ListBookmarksResponse object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required ListBookmarksResponseBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'bookmarks': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(BuiltList, [FullType(Bookmark)]), - ) as BuiltList; - result.bookmarks.replace(valueDes); - break; - case r'nextPageToken': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.nextPageToken = valueDes; - break; - case r'totalSize': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(int), - ) as int; - result.totalSize = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - ListBookmarksResponse deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = ListBookmarksResponseBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/packages/myfestival_client/lib/src/model/list_bookmarks_response.g.dart b/packages/myfestival_client/lib/src/model/list_bookmarks_response.g.dart deleted file mode 100644 index 27c58f54..00000000 --- a/packages/myfestival_client/lib/src/model/list_bookmarks_response.g.dart +++ /dev/null @@ -1,134 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'list_bookmarks_response.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -class _$ListBookmarksResponse extends ListBookmarksResponse { - @override - final BuiltList? bookmarks; - @override - final String? nextPageToken; - @override - final int? totalSize; - - factory _$ListBookmarksResponse( - [void Function(ListBookmarksResponseBuilder)? updates]) => - (ListBookmarksResponseBuilder()..update(updates))._build(); - - _$ListBookmarksResponse._( - {this.bookmarks, this.nextPageToken, this.totalSize}) - : super._(); - @override - ListBookmarksResponse rebuild( - void Function(ListBookmarksResponseBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - ListBookmarksResponseBuilder toBuilder() => - ListBookmarksResponseBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is ListBookmarksResponse && - bookmarks == other.bookmarks && - nextPageToken == other.nextPageToken && - totalSize == other.totalSize; - } - - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, bookmarks.hashCode); - _$hash = $jc(_$hash, nextPageToken.hashCode); - _$hash = $jc(_$hash, totalSize.hashCode); - _$hash = $jf(_$hash); - return _$hash; - } - - @override - String toString() { - return (newBuiltValueToStringHelper(r'ListBookmarksResponse') - ..add('bookmarks', bookmarks) - ..add('nextPageToken', nextPageToken) - ..add('totalSize', totalSize)) - .toString(); - } -} - -class ListBookmarksResponseBuilder - implements Builder { - _$ListBookmarksResponse? _$v; - - ListBuilder? _bookmarks; - ListBuilder get bookmarks => - _$this._bookmarks ??= ListBuilder(); - set bookmarks(ListBuilder? bookmarks) => - _$this._bookmarks = bookmarks; - - String? _nextPageToken; - String? get nextPageToken => _$this._nextPageToken; - set nextPageToken(String? nextPageToken) => - _$this._nextPageToken = nextPageToken; - - int? _totalSize; - int? get totalSize => _$this._totalSize; - set totalSize(int? totalSize) => _$this._totalSize = totalSize; - - ListBookmarksResponseBuilder() { - ListBookmarksResponse._defaults(this); - } - - ListBookmarksResponseBuilder get _$this { - final $v = _$v; - if ($v != null) { - _bookmarks = $v.bookmarks?.toBuilder(); - _nextPageToken = $v.nextPageToken; - _totalSize = $v.totalSize; - _$v = null; - } - return this; - } - - @override - void replace(ListBookmarksResponse other) { - _$v = other as _$ListBookmarksResponse; - } - - @override - void update(void Function(ListBookmarksResponseBuilder)? updates) { - if (updates != null) updates(this); - } - - @override - ListBookmarksResponse build() => _build(); - - _$ListBookmarksResponse _build() { - _$ListBookmarksResponse _$result; - try { - _$result = _$v ?? - _$ListBookmarksResponse._( - bookmarks: _bookmarks?.build(), - nextPageToken: nextPageToken, - totalSize: totalSize, - ); - } catch (_) { - late String _$failedField; - try { - _$failedField = 'bookmarks'; - _bookmarks?.build(); - } catch (e) { - throw BuiltValueNestedFieldError( - r'ListBookmarksResponse', _$failedField, e.toString()); - } - rethrow; - } - replace(_$result); - return _$result; - } -} - -// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/list_notes_response.dart b/packages/myfestival_client/lib/src/model/list_notes_response.dart deleted file mode 100644 index e1a49392..00000000 --- a/packages/myfestival_client/lib/src/model/list_notes_response.dart +++ /dev/null @@ -1,149 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:myfestival_client/src/model/note.dart'; -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'list_notes_response.g.dart'; - -/// Response message for ListNotes. -/// -/// Properties: -/// * [notes] - The caller's notes for this page, one per noted drink. -/// * [nextPageToken] - Token for the next page; empty when there are no more results. -/// * [totalSize] - Total number of drinks the caller has notes for at this festival. -@BuiltValue() -abstract class ListNotesResponse implements Built { - /// The caller's notes for this page, one per noted drink. - @BuiltValueField(wireName: r'notes') - BuiltList? get notes; - - /// Token for the next page; empty when there are no more results. - @BuiltValueField(wireName: r'nextPageToken') - String? get nextPageToken; - - /// Total number of drinks the caller has notes for at this festival. - @BuiltValueField(wireName: r'totalSize') - int? get totalSize; - - ListNotesResponse._(); - - factory ListNotesResponse([void updates(ListNotesResponseBuilder b)]) = _$ListNotesResponse; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ListNotesResponseBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ListNotesResponseSerializer(); -} - -class _$ListNotesResponseSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [ListNotesResponse, _$ListNotesResponse]; - - @override - final String wireName = r'ListNotesResponse'; - - Iterable _serializeProperties( - Serializers serializers, - ListNotesResponse object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.notes != null) { - yield r'notes'; - yield serializers.serialize( - object.notes, - specifiedType: const FullType(BuiltList, [FullType(Note)]), - ); - } - if (object.nextPageToken != null) { - yield r'nextPageToken'; - yield serializers.serialize( - object.nextPageToken, - specifiedType: const FullType(String), - ); - } - if (object.totalSize != null) { - yield r'totalSize'; - yield serializers.serialize( - object.totalSize, - specifiedType: const FullType(int), - ); - } - } - - @override - Object serialize( - Serializers serializers, - ListNotesResponse object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required ListNotesResponseBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'notes': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(BuiltList, [FullType(Note)]), - ) as BuiltList; - result.notes.replace(valueDes); - break; - case r'nextPageToken': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.nextPageToken = valueDes; - break; - case r'totalSize': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(int), - ) as int; - result.totalSize = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - ListNotesResponse deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = ListNotesResponseBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/packages/myfestival_client/lib/src/model/list_notes_response.g.dart b/packages/myfestival_client/lib/src/model/list_notes_response.g.dart deleted file mode 100644 index 22c1afec..00000000 --- a/packages/myfestival_client/lib/src/model/list_notes_response.g.dart +++ /dev/null @@ -1,130 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'list_notes_response.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -class _$ListNotesResponse extends ListNotesResponse { - @override - final BuiltList? notes; - @override - final String? nextPageToken; - @override - final int? totalSize; - - factory _$ListNotesResponse( - [void Function(ListNotesResponseBuilder)? updates]) => - (ListNotesResponseBuilder()..update(updates))._build(); - - _$ListNotesResponse._({this.notes, this.nextPageToken, this.totalSize}) - : super._(); - @override - ListNotesResponse rebuild(void Function(ListNotesResponseBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - ListNotesResponseBuilder toBuilder() => - ListNotesResponseBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is ListNotesResponse && - notes == other.notes && - nextPageToken == other.nextPageToken && - totalSize == other.totalSize; - } - - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, notes.hashCode); - _$hash = $jc(_$hash, nextPageToken.hashCode); - _$hash = $jc(_$hash, totalSize.hashCode); - _$hash = $jf(_$hash); - return _$hash; - } - - @override - String toString() { - return (newBuiltValueToStringHelper(r'ListNotesResponse') - ..add('notes', notes) - ..add('nextPageToken', nextPageToken) - ..add('totalSize', totalSize)) - .toString(); - } -} - -class ListNotesResponseBuilder - implements Builder { - _$ListNotesResponse? _$v; - - ListBuilder? _notes; - ListBuilder get notes => _$this._notes ??= ListBuilder(); - set notes(ListBuilder? notes) => _$this._notes = notes; - - String? _nextPageToken; - String? get nextPageToken => _$this._nextPageToken; - set nextPageToken(String? nextPageToken) => - _$this._nextPageToken = nextPageToken; - - int? _totalSize; - int? get totalSize => _$this._totalSize; - set totalSize(int? totalSize) => _$this._totalSize = totalSize; - - ListNotesResponseBuilder() { - ListNotesResponse._defaults(this); - } - - ListNotesResponseBuilder get _$this { - final $v = _$v; - if ($v != null) { - _notes = $v.notes?.toBuilder(); - _nextPageToken = $v.nextPageToken; - _totalSize = $v.totalSize; - _$v = null; - } - return this; - } - - @override - void replace(ListNotesResponse other) { - _$v = other as _$ListNotesResponse; - } - - @override - void update(void Function(ListNotesResponseBuilder)? updates) { - if (updates != null) updates(this); - } - - @override - ListNotesResponse build() => _build(); - - _$ListNotesResponse _build() { - _$ListNotesResponse _$result; - try { - _$result = _$v ?? - _$ListNotesResponse._( - notes: _notes?.build(), - nextPageToken: nextPageToken, - totalSize: totalSize, - ); - } catch (_) { - late String _$failedField; - try { - _$failedField = 'notes'; - _notes?.build(); - } catch (e) { - throw BuiltValueNestedFieldError( - r'ListNotesResponse', _$failedField, e.toString()); - } - rethrow; - } - replace(_$result); - return _$result; - } -} - -// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/list_review_summaries_response.dart b/packages/myfestival_client/lib/src/model/list_review_summaries_response.dart deleted file mode 100644 index c44eda0e..00000000 --- a/packages/myfestival_client/lib/src/model/list_review_summaries_response.dart +++ /dev/null @@ -1,149 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:myfestival_client/src/model/review_summary.dart'; -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'list_review_summaries_response.g.dart'; - -/// Response message for ListReviewSummaries. -/// -/// Properties: -/// * [reviewSummaries] - Aggregate review signals for this page, one per reviewed drink. -/// * [nextPageToken] - Token for the next page; empty when there are no more results. -/// * [totalSize] - Total number of drinks with at least one review at this festival. -@BuiltValue() -abstract class ListReviewSummariesResponse implements Built { - /// Aggregate review signals for this page, one per reviewed drink. - @BuiltValueField(wireName: r'reviewSummaries') - BuiltList? get reviewSummaries; - - /// Token for the next page; empty when there are no more results. - @BuiltValueField(wireName: r'nextPageToken') - String? get nextPageToken; - - /// Total number of drinks with at least one review at this festival. - @BuiltValueField(wireName: r'totalSize') - int? get totalSize; - - ListReviewSummariesResponse._(); - - factory ListReviewSummariesResponse([void updates(ListReviewSummariesResponseBuilder b)]) = _$ListReviewSummariesResponse; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ListReviewSummariesResponseBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ListReviewSummariesResponseSerializer(); -} - -class _$ListReviewSummariesResponseSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [ListReviewSummariesResponse, _$ListReviewSummariesResponse]; - - @override - final String wireName = r'ListReviewSummariesResponse'; - - Iterable _serializeProperties( - Serializers serializers, - ListReviewSummariesResponse object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.reviewSummaries != null) { - yield r'reviewSummaries'; - yield serializers.serialize( - object.reviewSummaries, - specifiedType: const FullType(BuiltList, [FullType(ReviewSummary)]), - ); - } - if (object.nextPageToken != null) { - yield r'nextPageToken'; - yield serializers.serialize( - object.nextPageToken, - specifiedType: const FullType(String), - ); - } - if (object.totalSize != null) { - yield r'totalSize'; - yield serializers.serialize( - object.totalSize, - specifiedType: const FullType(int), - ); - } - } - - @override - Object serialize( - Serializers serializers, - ListReviewSummariesResponse object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required ListReviewSummariesResponseBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'reviewSummaries': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(BuiltList, [FullType(ReviewSummary)]), - ) as BuiltList; - result.reviewSummaries.replace(valueDes); - break; - case r'nextPageToken': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.nextPageToken = valueDes; - break; - case r'totalSize': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(int), - ) as int; - result.totalSize = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - ListReviewSummariesResponse deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = ListReviewSummariesResponseBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/packages/myfestival_client/lib/src/model/list_review_summaries_response.g.dart b/packages/myfestival_client/lib/src/model/list_review_summaries_response.g.dart deleted file mode 100644 index c89ee4c0..00000000 --- a/packages/myfestival_client/lib/src/model/list_review_summaries_response.g.dart +++ /dev/null @@ -1,136 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'list_review_summaries_response.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -class _$ListReviewSummariesResponse extends ListReviewSummariesResponse { - @override - final BuiltList? reviewSummaries; - @override - final String? nextPageToken; - @override - final int? totalSize; - - factory _$ListReviewSummariesResponse( - [void Function(ListReviewSummariesResponseBuilder)? updates]) => - (ListReviewSummariesResponseBuilder()..update(updates))._build(); - - _$ListReviewSummariesResponse._( - {this.reviewSummaries, this.nextPageToken, this.totalSize}) - : super._(); - @override - ListReviewSummariesResponse rebuild( - void Function(ListReviewSummariesResponseBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - ListReviewSummariesResponseBuilder toBuilder() => - ListReviewSummariesResponseBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is ListReviewSummariesResponse && - reviewSummaries == other.reviewSummaries && - nextPageToken == other.nextPageToken && - totalSize == other.totalSize; - } - - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, reviewSummaries.hashCode); - _$hash = $jc(_$hash, nextPageToken.hashCode); - _$hash = $jc(_$hash, totalSize.hashCode); - _$hash = $jf(_$hash); - return _$hash; - } - - @override - String toString() { - return (newBuiltValueToStringHelper(r'ListReviewSummariesResponse') - ..add('reviewSummaries', reviewSummaries) - ..add('nextPageToken', nextPageToken) - ..add('totalSize', totalSize)) - .toString(); - } -} - -class ListReviewSummariesResponseBuilder - implements - Builder { - _$ListReviewSummariesResponse? _$v; - - ListBuilder? _reviewSummaries; - ListBuilder get reviewSummaries => - _$this._reviewSummaries ??= ListBuilder(); - set reviewSummaries(ListBuilder? reviewSummaries) => - _$this._reviewSummaries = reviewSummaries; - - String? _nextPageToken; - String? get nextPageToken => _$this._nextPageToken; - set nextPageToken(String? nextPageToken) => - _$this._nextPageToken = nextPageToken; - - int? _totalSize; - int? get totalSize => _$this._totalSize; - set totalSize(int? totalSize) => _$this._totalSize = totalSize; - - ListReviewSummariesResponseBuilder() { - ListReviewSummariesResponse._defaults(this); - } - - ListReviewSummariesResponseBuilder get _$this { - final $v = _$v; - if ($v != null) { - _reviewSummaries = $v.reviewSummaries?.toBuilder(); - _nextPageToken = $v.nextPageToken; - _totalSize = $v.totalSize; - _$v = null; - } - return this; - } - - @override - void replace(ListReviewSummariesResponse other) { - _$v = other as _$ListReviewSummariesResponse; - } - - @override - void update(void Function(ListReviewSummariesResponseBuilder)? updates) { - if (updates != null) updates(this); - } - - @override - ListReviewSummariesResponse build() => _build(); - - _$ListReviewSummariesResponse _build() { - _$ListReviewSummariesResponse _$result; - try { - _$result = _$v ?? - _$ListReviewSummariesResponse._( - reviewSummaries: _reviewSummaries?.build(), - nextPageToken: nextPageToken, - totalSize: totalSize, - ); - } catch (_) { - late String _$failedField; - try { - _$failedField = 'reviewSummaries'; - _reviewSummaries?.build(); - } catch (e) { - throw BuiltValueNestedFieldError( - r'ListReviewSummariesResponse', _$failedField, e.toString()); - } - rethrow; - } - replace(_$result); - return _$result; - } -} - -// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/list_reviews_response.dart b/packages/myfestival_client/lib/src/model/list_reviews_response.dart deleted file mode 100644 index 80fbbf95..00000000 --- a/packages/myfestival_client/lib/src/model/list_reviews_response.dart +++ /dev/null @@ -1,149 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_collection/built_collection.dart'; -import 'package:myfestival_client/src/model/review.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'list_reviews_response.g.dart'; - -/// Response message for ListReviews. -/// -/// Properties: -/// * [reviews] - The caller's reviews for this page, one per reviewed drink. -/// * [nextPageToken] - Token for the next page; empty when there are no more results. -/// * [totalSize] - Total number of drinks the caller has reviewed at this festival. -@BuiltValue() -abstract class ListReviewsResponse implements Built { - /// The caller's reviews for this page, one per reviewed drink. - @BuiltValueField(wireName: r'reviews') - BuiltList? get reviews; - - /// Token for the next page; empty when there are no more results. - @BuiltValueField(wireName: r'nextPageToken') - String? get nextPageToken; - - /// Total number of drinks the caller has reviewed at this festival. - @BuiltValueField(wireName: r'totalSize') - int? get totalSize; - - ListReviewsResponse._(); - - factory ListReviewsResponse([void updates(ListReviewsResponseBuilder b)]) = _$ListReviewsResponse; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ListReviewsResponseBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ListReviewsResponseSerializer(); -} - -class _$ListReviewsResponseSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [ListReviewsResponse, _$ListReviewsResponse]; - - @override - final String wireName = r'ListReviewsResponse'; - - Iterable _serializeProperties( - Serializers serializers, - ListReviewsResponse object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.reviews != null) { - yield r'reviews'; - yield serializers.serialize( - object.reviews, - specifiedType: const FullType(BuiltList, [FullType(Review)]), - ); - } - if (object.nextPageToken != null) { - yield r'nextPageToken'; - yield serializers.serialize( - object.nextPageToken, - specifiedType: const FullType(String), - ); - } - if (object.totalSize != null) { - yield r'totalSize'; - yield serializers.serialize( - object.totalSize, - specifiedType: const FullType(int), - ); - } - } - - @override - Object serialize( - Serializers serializers, - ListReviewsResponse object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required ListReviewsResponseBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'reviews': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(BuiltList, [FullType(Review)]), - ) as BuiltList; - result.reviews.replace(valueDes); - break; - case r'nextPageToken': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.nextPageToken = valueDes; - break; - case r'totalSize': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(int), - ) as int; - result.totalSize = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - ListReviewsResponse deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = ListReviewsResponseBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/packages/myfestival_client/lib/src/model/list_reviews_response.g.dart b/packages/myfestival_client/lib/src/model/list_reviews_response.g.dart deleted file mode 100644 index ffecd808..00000000 --- a/packages/myfestival_client/lib/src/model/list_reviews_response.g.dart +++ /dev/null @@ -1,131 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'list_reviews_response.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -class _$ListReviewsResponse extends ListReviewsResponse { - @override - final BuiltList? reviews; - @override - final String? nextPageToken; - @override - final int? totalSize; - - factory _$ListReviewsResponse( - [void Function(ListReviewsResponseBuilder)? updates]) => - (ListReviewsResponseBuilder()..update(updates))._build(); - - _$ListReviewsResponse._({this.reviews, this.nextPageToken, this.totalSize}) - : super._(); - @override - ListReviewsResponse rebuild( - void Function(ListReviewsResponseBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - ListReviewsResponseBuilder toBuilder() => - ListReviewsResponseBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is ListReviewsResponse && - reviews == other.reviews && - nextPageToken == other.nextPageToken && - totalSize == other.totalSize; - } - - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, reviews.hashCode); - _$hash = $jc(_$hash, nextPageToken.hashCode); - _$hash = $jc(_$hash, totalSize.hashCode); - _$hash = $jf(_$hash); - return _$hash; - } - - @override - String toString() { - return (newBuiltValueToStringHelper(r'ListReviewsResponse') - ..add('reviews', reviews) - ..add('nextPageToken', nextPageToken) - ..add('totalSize', totalSize)) - .toString(); - } -} - -class ListReviewsResponseBuilder - implements Builder { - _$ListReviewsResponse? _$v; - - ListBuilder? _reviews; - ListBuilder get reviews => _$this._reviews ??= ListBuilder(); - set reviews(ListBuilder? reviews) => _$this._reviews = reviews; - - String? _nextPageToken; - String? get nextPageToken => _$this._nextPageToken; - set nextPageToken(String? nextPageToken) => - _$this._nextPageToken = nextPageToken; - - int? _totalSize; - int? get totalSize => _$this._totalSize; - set totalSize(int? totalSize) => _$this._totalSize = totalSize; - - ListReviewsResponseBuilder() { - ListReviewsResponse._defaults(this); - } - - ListReviewsResponseBuilder get _$this { - final $v = _$v; - if ($v != null) { - _reviews = $v.reviews?.toBuilder(); - _nextPageToken = $v.nextPageToken; - _totalSize = $v.totalSize; - _$v = null; - } - return this; - } - - @override - void replace(ListReviewsResponse other) { - _$v = other as _$ListReviewsResponse; - } - - @override - void update(void Function(ListReviewsResponseBuilder)? updates) { - if (updates != null) updates(this); - } - - @override - ListReviewsResponse build() => _build(); - - _$ListReviewsResponse _build() { - _$ListReviewsResponse _$result; - try { - _$result = _$v ?? - _$ListReviewsResponse._( - reviews: _reviews?.build(), - nextPageToken: nextPageToken, - totalSize: totalSize, - ); - } catch (_) { - late String _$failedField; - try { - _$failedField = 'reviews'; - _reviews?.build(); - } catch (e) { - throw BuiltValueNestedFieldError( - r'ListReviewsResponse', _$failedField, e.toString()); - } - rethrow; - } - replace(_$result); - return _$result; - } -} - -// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/list_tasting_summaries_response.dart b/packages/myfestival_client/lib/src/model/list_tasting_summaries_response.dart deleted file mode 100644 index 2490fffb..00000000 --- a/packages/myfestival_client/lib/src/model/list_tasting_summaries_response.dart +++ /dev/null @@ -1,149 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_collection/built_collection.dart'; -import 'package:myfestival_client/src/model/tasting_summary.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'list_tasting_summaries_response.g.dart'; - -/// Response message for ListTastingSummaries. -/// -/// Properties: -/// * [tastingSummaries] - Tasting counts for this page, one per tried drink. -/// * [nextPageToken] - Token for the next page; empty when there are no more results. -/// * [totalSize] - Total number of drinks tried by at least one caller at this festival. -@BuiltValue() -abstract class ListTastingSummariesResponse implements Built { - /// Tasting counts for this page, one per tried drink. - @BuiltValueField(wireName: r'tastingSummaries') - BuiltList? get tastingSummaries; - - /// Token for the next page; empty when there are no more results. - @BuiltValueField(wireName: r'nextPageToken') - String? get nextPageToken; - - /// Total number of drinks tried by at least one caller at this festival. - @BuiltValueField(wireName: r'totalSize') - int? get totalSize; - - ListTastingSummariesResponse._(); - - factory ListTastingSummariesResponse([void updates(ListTastingSummariesResponseBuilder b)]) = _$ListTastingSummariesResponse; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ListTastingSummariesResponseBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ListTastingSummariesResponseSerializer(); -} - -class _$ListTastingSummariesResponseSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [ListTastingSummariesResponse, _$ListTastingSummariesResponse]; - - @override - final String wireName = r'ListTastingSummariesResponse'; - - Iterable _serializeProperties( - Serializers serializers, - ListTastingSummariesResponse object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.tastingSummaries != null) { - yield r'tastingSummaries'; - yield serializers.serialize( - object.tastingSummaries, - specifiedType: const FullType(BuiltList, [FullType(TastingSummary)]), - ); - } - if (object.nextPageToken != null) { - yield r'nextPageToken'; - yield serializers.serialize( - object.nextPageToken, - specifiedType: const FullType(String), - ); - } - if (object.totalSize != null) { - yield r'totalSize'; - yield serializers.serialize( - object.totalSize, - specifiedType: const FullType(int), - ); - } - } - - @override - Object serialize( - Serializers serializers, - ListTastingSummariesResponse object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required ListTastingSummariesResponseBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'tastingSummaries': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(BuiltList, [FullType(TastingSummary)]), - ) as BuiltList; - result.tastingSummaries.replace(valueDes); - break; - case r'nextPageToken': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.nextPageToken = valueDes; - break; - case r'totalSize': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(int), - ) as int; - result.totalSize = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - ListTastingSummariesResponse deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = ListTastingSummariesResponseBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/packages/myfestival_client/lib/src/model/list_tasting_summaries_response.g.dart b/packages/myfestival_client/lib/src/model/list_tasting_summaries_response.g.dart deleted file mode 100644 index c143dab2..00000000 --- a/packages/myfestival_client/lib/src/model/list_tasting_summaries_response.g.dart +++ /dev/null @@ -1,136 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'list_tasting_summaries_response.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -class _$ListTastingSummariesResponse extends ListTastingSummariesResponse { - @override - final BuiltList? tastingSummaries; - @override - final String? nextPageToken; - @override - final int? totalSize; - - factory _$ListTastingSummariesResponse( - [void Function(ListTastingSummariesResponseBuilder)? updates]) => - (ListTastingSummariesResponseBuilder()..update(updates))._build(); - - _$ListTastingSummariesResponse._( - {this.tastingSummaries, this.nextPageToken, this.totalSize}) - : super._(); - @override - ListTastingSummariesResponse rebuild( - void Function(ListTastingSummariesResponseBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - ListTastingSummariesResponseBuilder toBuilder() => - ListTastingSummariesResponseBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is ListTastingSummariesResponse && - tastingSummaries == other.tastingSummaries && - nextPageToken == other.nextPageToken && - totalSize == other.totalSize; - } - - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, tastingSummaries.hashCode); - _$hash = $jc(_$hash, nextPageToken.hashCode); - _$hash = $jc(_$hash, totalSize.hashCode); - _$hash = $jf(_$hash); - return _$hash; - } - - @override - String toString() { - return (newBuiltValueToStringHelper(r'ListTastingSummariesResponse') - ..add('tastingSummaries', tastingSummaries) - ..add('nextPageToken', nextPageToken) - ..add('totalSize', totalSize)) - .toString(); - } -} - -class ListTastingSummariesResponseBuilder - implements - Builder { - _$ListTastingSummariesResponse? _$v; - - ListBuilder? _tastingSummaries; - ListBuilder get tastingSummaries => - _$this._tastingSummaries ??= ListBuilder(); - set tastingSummaries(ListBuilder? tastingSummaries) => - _$this._tastingSummaries = tastingSummaries; - - String? _nextPageToken; - String? get nextPageToken => _$this._nextPageToken; - set nextPageToken(String? nextPageToken) => - _$this._nextPageToken = nextPageToken; - - int? _totalSize; - int? get totalSize => _$this._totalSize; - set totalSize(int? totalSize) => _$this._totalSize = totalSize; - - ListTastingSummariesResponseBuilder() { - ListTastingSummariesResponse._defaults(this); - } - - ListTastingSummariesResponseBuilder get _$this { - final $v = _$v; - if ($v != null) { - _tastingSummaries = $v.tastingSummaries?.toBuilder(); - _nextPageToken = $v.nextPageToken; - _totalSize = $v.totalSize; - _$v = null; - } - return this; - } - - @override - void replace(ListTastingSummariesResponse other) { - _$v = other as _$ListTastingSummariesResponse; - } - - @override - void update(void Function(ListTastingSummariesResponseBuilder)? updates) { - if (updates != null) updates(this); - } - - @override - ListTastingSummariesResponse build() => _build(); - - _$ListTastingSummariesResponse _build() { - _$ListTastingSummariesResponse _$result; - try { - _$result = _$v ?? - _$ListTastingSummariesResponse._( - tastingSummaries: _tastingSummaries?.build(), - nextPageToken: nextPageToken, - totalSize: totalSize, - ); - } catch (_) { - late String _$failedField; - try { - _$failedField = 'tastingSummaries'; - _tastingSummaries?.build(); - } catch (e) { - throw BuiltValueNestedFieldError( - r'ListTastingSummariesResponse', _$failedField, e.toString()); - } - rethrow; - } - replace(_$result); - return _$result; - } -} - -// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/list_tastings_response.dart b/packages/myfestival_client/lib/src/model/list_tastings_response.dart deleted file mode 100644 index ee79b130..00000000 --- a/packages/myfestival_client/lib/src/model/list_tastings_response.dart +++ /dev/null @@ -1,149 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_collection/built_collection.dart'; -import 'package:myfestival_client/src/model/tasting.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'list_tastings_response.g.dart'; - -/// Response message for ListTastings. -/// -/// Properties: -/// * [tastings] - The caller's tasting records for this page, one per tried drink. -/// * [nextPageToken] - Token for the next page; empty when there are no more results. -/// * [totalSize] - Total number of drinks the caller has tried at this festival. -@BuiltValue() -abstract class ListTastingsResponse implements Built { - /// The caller's tasting records for this page, one per tried drink. - @BuiltValueField(wireName: r'tastings') - BuiltList? get tastings; - - /// Token for the next page; empty when there are no more results. - @BuiltValueField(wireName: r'nextPageToken') - String? get nextPageToken; - - /// Total number of drinks the caller has tried at this festival. - @BuiltValueField(wireName: r'totalSize') - int? get totalSize; - - ListTastingsResponse._(); - - factory ListTastingsResponse([void updates(ListTastingsResponseBuilder b)]) = _$ListTastingsResponse; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ListTastingsResponseBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ListTastingsResponseSerializer(); -} - -class _$ListTastingsResponseSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [ListTastingsResponse, _$ListTastingsResponse]; - - @override - final String wireName = r'ListTastingsResponse'; - - Iterable _serializeProperties( - Serializers serializers, - ListTastingsResponse object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.tastings != null) { - yield r'tastings'; - yield serializers.serialize( - object.tastings, - specifiedType: const FullType(BuiltList, [FullType(Tasting)]), - ); - } - if (object.nextPageToken != null) { - yield r'nextPageToken'; - yield serializers.serialize( - object.nextPageToken, - specifiedType: const FullType(String), - ); - } - if (object.totalSize != null) { - yield r'totalSize'; - yield serializers.serialize( - object.totalSize, - specifiedType: const FullType(int), - ); - } - } - - @override - Object serialize( - Serializers serializers, - ListTastingsResponse object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required ListTastingsResponseBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'tastings': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(BuiltList, [FullType(Tasting)]), - ) as BuiltList; - result.tastings.replace(valueDes); - break; - case r'nextPageToken': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.nextPageToken = valueDes; - break; - case r'totalSize': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(int), - ) as int; - result.totalSize = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - ListTastingsResponse deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = ListTastingsResponseBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/packages/myfestival_client/lib/src/model/list_tastings_response.g.dart b/packages/myfestival_client/lib/src/model/list_tastings_response.g.dart deleted file mode 100644 index f9b2fc5a..00000000 --- a/packages/myfestival_client/lib/src/model/list_tastings_response.g.dart +++ /dev/null @@ -1,132 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'list_tastings_response.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -class _$ListTastingsResponse extends ListTastingsResponse { - @override - final BuiltList? tastings; - @override - final String? nextPageToken; - @override - final int? totalSize; - - factory _$ListTastingsResponse( - [void Function(ListTastingsResponseBuilder)? updates]) => - (ListTastingsResponseBuilder()..update(updates))._build(); - - _$ListTastingsResponse._({this.tastings, this.nextPageToken, this.totalSize}) - : super._(); - @override - ListTastingsResponse rebuild( - void Function(ListTastingsResponseBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - ListTastingsResponseBuilder toBuilder() => - ListTastingsResponseBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is ListTastingsResponse && - tastings == other.tastings && - nextPageToken == other.nextPageToken && - totalSize == other.totalSize; - } - - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, tastings.hashCode); - _$hash = $jc(_$hash, nextPageToken.hashCode); - _$hash = $jc(_$hash, totalSize.hashCode); - _$hash = $jf(_$hash); - return _$hash; - } - - @override - String toString() { - return (newBuiltValueToStringHelper(r'ListTastingsResponse') - ..add('tastings', tastings) - ..add('nextPageToken', nextPageToken) - ..add('totalSize', totalSize)) - .toString(); - } -} - -class ListTastingsResponseBuilder - implements Builder { - _$ListTastingsResponse? _$v; - - ListBuilder? _tastings; - ListBuilder get tastings => - _$this._tastings ??= ListBuilder(); - set tastings(ListBuilder? tastings) => _$this._tastings = tastings; - - String? _nextPageToken; - String? get nextPageToken => _$this._nextPageToken; - set nextPageToken(String? nextPageToken) => - _$this._nextPageToken = nextPageToken; - - int? _totalSize; - int? get totalSize => _$this._totalSize; - set totalSize(int? totalSize) => _$this._totalSize = totalSize; - - ListTastingsResponseBuilder() { - ListTastingsResponse._defaults(this); - } - - ListTastingsResponseBuilder get _$this { - final $v = _$v; - if ($v != null) { - _tastings = $v.tastings?.toBuilder(); - _nextPageToken = $v.nextPageToken; - _totalSize = $v.totalSize; - _$v = null; - } - return this; - } - - @override - void replace(ListTastingsResponse other) { - _$v = other as _$ListTastingsResponse; - } - - @override - void update(void Function(ListTastingsResponseBuilder)? updates) { - if (updates != null) updates(this); - } - - @override - ListTastingsResponse build() => _build(); - - _$ListTastingsResponse _build() { - _$ListTastingsResponse _$result; - try { - _$result = _$v ?? - _$ListTastingsResponse._( - tastings: _tastings?.build(), - nextPageToken: nextPageToken, - totalSize: totalSize, - ); - } catch (_) { - late String _$failedField; - try { - _$failedField = 'tastings'; - _tastings?.build(); - } catch (e) { - throw BuiltValueNestedFieldError( - r'ListTastingsResponse', _$failedField, e.toString()); - } - rethrow; - } - replace(_$result); - return _$result; - } -} - -// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/note.dart b/packages/myfestival_client/lib/src/model/note.dart deleted file mode 100644 index 0edb85a8..00000000 --- a/packages/myfestival_client/lib/src/model/note.dart +++ /dev/null @@ -1,145 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'note.g.dart'; - -/// The caller's free-text tasting note for one drink at one festival. Singleton resource — one per (caller, drink). The caller is implicit in the auth context. A note is independent of a Review: you can note without rating, or rate without noting. -/// -/// Properties: -/// * [name] - Resource name: festivals/{festival}/drinks/{drink}/note. -/// * [content] - The caller's note text. Max 2000 Unicode characters. -/// * [updateTime] - When this note was last written. -@BuiltValue() -abstract class Note implements Built { - /// Resource name: festivals/{festival}/drinks/{drink}/note. - @BuiltValueField(wireName: r'name') - String? get name; - - /// The caller's note text. Max 2000 Unicode characters. - @BuiltValueField(wireName: r'content') - String get content; - - /// When this note was last written. - @BuiltValueField(wireName: r'updateTime') - DateTime? get updateTime; - - Note._(); - - factory Note([void updates(NoteBuilder b)]) = _$Note; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(NoteBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$NoteSerializer(); -} - -class _$NoteSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [Note, _$Note]; - - @override - final String wireName = r'Note'; - - Iterable _serializeProperties( - Serializers serializers, - Note object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); - } - yield r'content'; - yield serializers.serialize( - object.content, - specifiedType: const FullType(String), - ); - if (object.updateTime != null) { - yield r'updateTime'; - yield serializers.serialize( - object.updateTime, - specifiedType: const FullType(DateTime), - ); - } - } - - @override - Object serialize( - Serializers serializers, - Note object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required NoteBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'name': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.name = valueDes; - break; - case r'content': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.content = valueDes; - break; - case r'updateTime': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(DateTime), - ) as DateTime; - result.updateTime = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - Note deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = NoteBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/packages/myfestival_client/lib/src/model/note.g.dart b/packages/myfestival_client/lib/src/model/note.g.dart deleted file mode 100644 index 86e5bea1..00000000 --- a/packages/myfestival_client/lib/src/model/note.g.dart +++ /dev/null @@ -1,113 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'note.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -class _$Note extends Note { - @override - final String? name; - @override - final String content; - @override - final DateTime? updateTime; - - factory _$Note([void Function(NoteBuilder)? updates]) => - (NoteBuilder()..update(updates))._build(); - - _$Note._({this.name, required this.content, this.updateTime}) : super._(); - @override - Note rebuild(void Function(NoteBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - NoteBuilder toBuilder() => NoteBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is Note && - name == other.name && - content == other.content && - updateTime == other.updateTime; - } - - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, name.hashCode); - _$hash = $jc(_$hash, content.hashCode); - _$hash = $jc(_$hash, updateTime.hashCode); - _$hash = $jf(_$hash); - return _$hash; - } - - @override - String toString() { - return (newBuiltValueToStringHelper(r'Note') - ..add('name', name) - ..add('content', content) - ..add('updateTime', updateTime)) - .toString(); - } -} - -class NoteBuilder implements Builder { - _$Note? _$v; - - String? _name; - String? get name => _$this._name; - set name(String? name) => _$this._name = name; - - String? _content; - String? get content => _$this._content; - set content(String? content) => _$this._content = content; - - DateTime? _updateTime; - DateTime? get updateTime => _$this._updateTime; - set updateTime(DateTime? updateTime) => _$this._updateTime = updateTime; - - NoteBuilder() { - Note._defaults(this); - } - - NoteBuilder get _$this { - final $v = _$v; - if ($v != null) { - _name = $v.name; - _content = $v.content; - _updateTime = $v.updateTime; - _$v = null; - } - return this; - } - - @override - void replace(Note other) { - _$v = other as _$Note; - } - - @override - void update(void Function(NoteBuilder)? updates) { - if (updates != null) updates(this); - } - - @override - Note build() => _build(); - - _$Note _build() { - final _$result = _$v ?? - _$Note._( - name: name, - content: BuiltValueNullFieldError.checkNotNull( - content, r'Note', 'content'), - updateTime: updateTime, - ); - replace(_$result); - return _$result; - } -} - -// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/review.dart b/packages/myfestival_client/lib/src/model/review.dart deleted file mode 100644 index ad2c93d4..00000000 --- a/packages/myfestival_client/lib/src/model/review.dart +++ /dev/null @@ -1,166 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'review.g.dart'; - -/// The caller's review of one drink at one festival: a star rating (1-5) and/or a \"would recommend\" answer. Singleton resource — one per (caller, drink). The caller is implicit in the auth context; their identity never appears in the resource name, keeping device IDs private and making the sign-in upgrade transparent to clients. Both signals are optional and independent: a caller can rate without answering the recommendation question, or vice versa. -/// -/// Properties: -/// * [name] - Resource name: festivals/{festival}/drinks/{drink}/review. -/// * [starRating] - Star rating, 1–5 inclusive. Absent if the caller has not set a star rating. -/// * [wouldRecommend] - Whether the caller would recommend this drink. Absent if not answered. -/// * [updateTime] - When this review was last written. -@BuiltValue() -abstract class Review implements Built { - /// Resource name: festivals/{festival}/drinks/{drink}/review. - @BuiltValueField(wireName: r'name') - String? get name; - - /// Star rating, 1–5 inclusive. Absent if the caller has not set a star rating. - @BuiltValueField(wireName: r'starRating') - int? get starRating; - - /// Whether the caller would recommend this drink. Absent if not answered. - @BuiltValueField(wireName: r'wouldRecommend') - bool? get wouldRecommend; - - /// When this review was last written. - @BuiltValueField(wireName: r'updateTime') - DateTime? get updateTime; - - Review._(); - - factory Review([void updates(ReviewBuilder b)]) = _$Review; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ReviewBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ReviewSerializer(); -} - -class _$ReviewSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [Review, _$Review]; - - @override - final String wireName = r'Review'; - - Iterable _serializeProperties( - Serializers serializers, - Review object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); - } - if (object.starRating != null) { - yield r'starRating'; - yield serializers.serialize( - object.starRating, - specifiedType: const FullType(int), - ); - } - if (object.wouldRecommend != null) { - yield r'wouldRecommend'; - yield serializers.serialize( - object.wouldRecommend, - specifiedType: const FullType(bool), - ); - } - if (object.updateTime != null) { - yield r'updateTime'; - yield serializers.serialize( - object.updateTime, - specifiedType: const FullType(DateTime), - ); - } - } - - @override - Object serialize( - Serializers serializers, - Review object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required ReviewBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'name': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.name = valueDes; - break; - case r'starRating': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(int), - ) as int; - result.starRating = valueDes; - break; - case r'wouldRecommend': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(bool), - ) as bool; - result.wouldRecommend = valueDes; - break; - case r'updateTime': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(DateTime), - ) as DateTime; - result.updateTime = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - Review deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = ReviewBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/packages/myfestival_client/lib/src/model/review.g.dart b/packages/myfestival_client/lib/src/model/review.g.dart deleted file mode 100644 index 164f820c..00000000 --- a/packages/myfestival_client/lib/src/model/review.g.dart +++ /dev/null @@ -1,125 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'review.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -class _$Review extends Review { - @override - final String? name; - @override - final int? starRating; - @override - final bool? wouldRecommend; - @override - final DateTime? updateTime; - - factory _$Review([void Function(ReviewBuilder)? updates]) => - (ReviewBuilder()..update(updates))._build(); - - _$Review._({this.name, this.starRating, this.wouldRecommend, this.updateTime}) - : super._(); - @override - Review rebuild(void Function(ReviewBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - ReviewBuilder toBuilder() => ReviewBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is Review && - name == other.name && - starRating == other.starRating && - wouldRecommend == other.wouldRecommend && - updateTime == other.updateTime; - } - - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, name.hashCode); - _$hash = $jc(_$hash, starRating.hashCode); - _$hash = $jc(_$hash, wouldRecommend.hashCode); - _$hash = $jc(_$hash, updateTime.hashCode); - _$hash = $jf(_$hash); - return _$hash; - } - - @override - String toString() { - return (newBuiltValueToStringHelper(r'Review') - ..add('name', name) - ..add('starRating', starRating) - ..add('wouldRecommend', wouldRecommend) - ..add('updateTime', updateTime)) - .toString(); - } -} - -class ReviewBuilder implements Builder { - _$Review? _$v; - - String? _name; - String? get name => _$this._name; - set name(String? name) => _$this._name = name; - - int? _starRating; - int? get starRating => _$this._starRating; - set starRating(int? starRating) => _$this._starRating = starRating; - - bool? _wouldRecommend; - bool? get wouldRecommend => _$this._wouldRecommend; - set wouldRecommend(bool? wouldRecommend) => - _$this._wouldRecommend = wouldRecommend; - - DateTime? _updateTime; - DateTime? get updateTime => _$this._updateTime; - set updateTime(DateTime? updateTime) => _$this._updateTime = updateTime; - - ReviewBuilder() { - Review._defaults(this); - } - - ReviewBuilder get _$this { - final $v = _$v; - if ($v != null) { - _name = $v.name; - _starRating = $v.starRating; - _wouldRecommend = $v.wouldRecommend; - _updateTime = $v.updateTime; - _$v = null; - } - return this; - } - - @override - void replace(Review other) { - _$v = other as _$Review; - } - - @override - void update(void Function(ReviewBuilder)? updates) { - if (updates != null) updates(this); - } - - @override - Review build() => _build(); - - _$Review _build() { - final _$result = _$v ?? - _$Review._( - name: name, - starRating: starRating, - wouldRecommend: wouldRecommend, - updateTime: updateTime, - ); - replace(_$result); - return _$result; - } -} - -// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/review_summary.dart b/packages/myfestival_client/lib/src/model/review_summary.dart deleted file mode 100644 index ff197ef8..00000000 --- a/packages/myfestival_client/lib/src/model/review_summary.dart +++ /dev/null @@ -1,204 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'review_summary.g.dart'; - -/// Computed, read-only aggregate of all callers' reviews for one drink. Keyed by drink under the festival so the whole festival can be fetched in one paginated call for list/grid views. -/// -/// Properties: -/// * [name] - Resource name: festivals/{festival}/reviewSummaries/{drink}. -/// * [ratingCount] - Number of callers who have submitted a star rating. -/// * [averageRating] - Mean star rating across all callers (1.0–5.0); 0 when rating_count is 0. -/// * [responseCount] - Number of callers who have answered the \"would recommend\" question. -/// * [recommendCount] - Number of callers who answered \"yes\" to the recommendation question. -/// * [recommendRate] - Fraction of responses (0.0–1.0) that would recommend; 0 when response_count is 0. -@BuiltValue() -abstract class ReviewSummary implements Built { - /// Resource name: festivals/{festival}/reviewSummaries/{drink}. - @BuiltValueField(wireName: r'name') - String? get name; - - /// Number of callers who have submitted a star rating. - @BuiltValueField(wireName: r'ratingCount') - int? get ratingCount; - - /// Mean star rating across all callers (1.0–5.0); 0 when rating_count is 0. - @BuiltValueField(wireName: r'averageRating') - double? get averageRating; - - /// Number of callers who have answered the \"would recommend\" question. - @BuiltValueField(wireName: r'responseCount') - int? get responseCount; - - /// Number of callers who answered \"yes\" to the recommendation question. - @BuiltValueField(wireName: r'recommendCount') - int? get recommendCount; - - /// Fraction of responses (0.0–1.0) that would recommend; 0 when response_count is 0. - @BuiltValueField(wireName: r'recommendRate') - double? get recommendRate; - - ReviewSummary._(); - - factory ReviewSummary([void updates(ReviewSummaryBuilder b)]) = _$ReviewSummary; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ReviewSummaryBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ReviewSummarySerializer(); -} - -class _$ReviewSummarySerializer implements PrimitiveSerializer { - @override - final Iterable types = const [ReviewSummary, _$ReviewSummary]; - - @override - final String wireName = r'ReviewSummary'; - - Iterable _serializeProperties( - Serializers serializers, - ReviewSummary object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); - } - if (object.ratingCount != null) { - yield r'ratingCount'; - yield serializers.serialize( - object.ratingCount, - specifiedType: const FullType(int), - ); - } - if (object.averageRating != null) { - yield r'averageRating'; - yield serializers.serialize( - object.averageRating, - specifiedType: const FullType(double), - ); - } - if (object.responseCount != null) { - yield r'responseCount'; - yield serializers.serialize( - object.responseCount, - specifiedType: const FullType(int), - ); - } - if (object.recommendCount != null) { - yield r'recommendCount'; - yield serializers.serialize( - object.recommendCount, - specifiedType: const FullType(int), - ); - } - if (object.recommendRate != null) { - yield r'recommendRate'; - yield serializers.serialize( - object.recommendRate, - specifiedType: const FullType(double), - ); - } - } - - @override - Object serialize( - Serializers serializers, - ReviewSummary object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required ReviewSummaryBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'name': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.name = valueDes; - break; - case r'ratingCount': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(int), - ) as int; - result.ratingCount = valueDes; - break; - case r'averageRating': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(double), - ) as double; - result.averageRating = valueDes; - break; - case r'responseCount': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(int), - ) as int; - result.responseCount = valueDes; - break; - case r'recommendCount': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(int), - ) as int; - result.recommendCount = valueDes; - break; - case r'recommendRate': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(double), - ) as double; - result.recommendRate = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - ReviewSummary deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = ReviewSummaryBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/packages/myfestival_client/lib/src/model/review_summary.g.dart b/packages/myfestival_client/lib/src/model/review_summary.g.dart deleted file mode 100644 index 643928c6..00000000 --- a/packages/myfestival_client/lib/src/model/review_summary.g.dart +++ /dev/null @@ -1,157 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'review_summary.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -class _$ReviewSummary extends ReviewSummary { - @override - final String? name; - @override - final int? ratingCount; - @override - final double? averageRating; - @override - final int? responseCount; - @override - final int? recommendCount; - @override - final double? recommendRate; - - factory _$ReviewSummary([void Function(ReviewSummaryBuilder)? updates]) => - (ReviewSummaryBuilder()..update(updates))._build(); - - _$ReviewSummary._( - {this.name, - this.ratingCount, - this.averageRating, - this.responseCount, - this.recommendCount, - this.recommendRate}) - : super._(); - @override - ReviewSummary rebuild(void Function(ReviewSummaryBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - ReviewSummaryBuilder toBuilder() => ReviewSummaryBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is ReviewSummary && - name == other.name && - ratingCount == other.ratingCount && - averageRating == other.averageRating && - responseCount == other.responseCount && - recommendCount == other.recommendCount && - recommendRate == other.recommendRate; - } - - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, name.hashCode); - _$hash = $jc(_$hash, ratingCount.hashCode); - _$hash = $jc(_$hash, averageRating.hashCode); - _$hash = $jc(_$hash, responseCount.hashCode); - _$hash = $jc(_$hash, recommendCount.hashCode); - _$hash = $jc(_$hash, recommendRate.hashCode); - _$hash = $jf(_$hash); - return _$hash; - } - - @override - String toString() { - return (newBuiltValueToStringHelper(r'ReviewSummary') - ..add('name', name) - ..add('ratingCount', ratingCount) - ..add('averageRating', averageRating) - ..add('responseCount', responseCount) - ..add('recommendCount', recommendCount) - ..add('recommendRate', recommendRate)) - .toString(); - } -} - -class ReviewSummaryBuilder - implements Builder { - _$ReviewSummary? _$v; - - String? _name; - String? get name => _$this._name; - set name(String? name) => _$this._name = name; - - int? _ratingCount; - int? get ratingCount => _$this._ratingCount; - set ratingCount(int? ratingCount) => _$this._ratingCount = ratingCount; - - double? _averageRating; - double? get averageRating => _$this._averageRating; - set averageRating(double? averageRating) => - _$this._averageRating = averageRating; - - int? _responseCount; - int? get responseCount => _$this._responseCount; - set responseCount(int? responseCount) => - _$this._responseCount = responseCount; - - int? _recommendCount; - int? get recommendCount => _$this._recommendCount; - set recommendCount(int? recommendCount) => - _$this._recommendCount = recommendCount; - - double? _recommendRate; - double? get recommendRate => _$this._recommendRate; - set recommendRate(double? recommendRate) => - _$this._recommendRate = recommendRate; - - ReviewSummaryBuilder() { - ReviewSummary._defaults(this); - } - - ReviewSummaryBuilder get _$this { - final $v = _$v; - if ($v != null) { - _name = $v.name; - _ratingCount = $v.ratingCount; - _averageRating = $v.averageRating; - _responseCount = $v.responseCount; - _recommendCount = $v.recommendCount; - _recommendRate = $v.recommendRate; - _$v = null; - } - return this; - } - - @override - void replace(ReviewSummary other) { - _$v = other as _$ReviewSummary; - } - - @override - void update(void Function(ReviewSummaryBuilder)? updates) { - if (updates != null) updates(this); - } - - @override - ReviewSummary build() => _build(); - - _$ReviewSummary _build() { - final _$result = _$v ?? - _$ReviewSummary._( - name: name, - ratingCount: ratingCount, - averageRating: averageRating, - responseCount: responseCount, - recommendCount: recommendCount, - recommendRate: recommendRate, - ); - replace(_$result); - return _$result; - } -} - -// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/tasting.dart b/packages/myfestival_client/lib/src/model/tasting.dart deleted file mode 100644 index db07da94..00000000 --- a/packages/myfestival_client/lib/src/model/tasting.dart +++ /dev/null @@ -1,166 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'tasting.g.dart'; - -/// A record that the caller has tried a drink at a festival. Singleton resource — one per (caller, drink). The caller is implicit in the auth context. `pours` tracks how many times the caller has had this drink at the festival (e.g. returned for a second half-pint); absent means one pour. -/// -/// Properties: -/// * [name] - Resource name: festivals/{festival}/drinks/{drink}/tasting. -/// * [pours] - How many times the caller has had this drink. Absent means one pour. Must be >= 1 when present. -/// * [createTime] - When the caller first tried this drink. -/// * [updateTime] - When this record was last updated. -@BuiltValue() -abstract class Tasting implements Built { - /// Resource name: festivals/{festival}/drinks/{drink}/tasting. - @BuiltValueField(wireName: r'name') - String? get name; - - /// How many times the caller has had this drink. Absent means one pour. Must be >= 1 when present. - @BuiltValueField(wireName: r'pours') - int? get pours; - - /// When the caller first tried this drink. - @BuiltValueField(wireName: r'createTime') - DateTime? get createTime; - - /// When this record was last updated. - @BuiltValueField(wireName: r'updateTime') - DateTime? get updateTime; - - Tasting._(); - - factory Tasting([void updates(TastingBuilder b)]) = _$Tasting; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(TastingBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$TastingSerializer(); -} - -class _$TastingSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [Tasting, _$Tasting]; - - @override - final String wireName = r'Tasting'; - - Iterable _serializeProperties( - Serializers serializers, - Tasting object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); - } - if (object.pours != null) { - yield r'pours'; - yield serializers.serialize( - object.pours, - specifiedType: const FullType(int), - ); - } - if (object.createTime != null) { - yield r'createTime'; - yield serializers.serialize( - object.createTime, - specifiedType: const FullType(DateTime), - ); - } - if (object.updateTime != null) { - yield r'updateTime'; - yield serializers.serialize( - object.updateTime, - specifiedType: const FullType(DateTime), - ); - } - } - - @override - Object serialize( - Serializers serializers, - Tasting object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required TastingBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'name': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.name = valueDes; - break; - case r'pours': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(int), - ) as int; - result.pours = valueDes; - break; - case r'createTime': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(DateTime), - ) as DateTime; - result.createTime = valueDes; - break; - case r'updateTime': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(DateTime), - ) as DateTime; - result.updateTime = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - Tasting deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = TastingBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/packages/myfestival_client/lib/src/model/tasting.g.dart b/packages/myfestival_client/lib/src/model/tasting.g.dart deleted file mode 100644 index 32200f8a..00000000 --- a/packages/myfestival_client/lib/src/model/tasting.g.dart +++ /dev/null @@ -1,124 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'tasting.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -class _$Tasting extends Tasting { - @override - final String? name; - @override - final int? pours; - @override - final DateTime? createTime; - @override - final DateTime? updateTime; - - factory _$Tasting([void Function(TastingBuilder)? updates]) => - (TastingBuilder()..update(updates))._build(); - - _$Tasting._({this.name, this.pours, this.createTime, this.updateTime}) - : super._(); - @override - Tasting rebuild(void Function(TastingBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - TastingBuilder toBuilder() => TastingBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is Tasting && - name == other.name && - pours == other.pours && - createTime == other.createTime && - updateTime == other.updateTime; - } - - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, name.hashCode); - _$hash = $jc(_$hash, pours.hashCode); - _$hash = $jc(_$hash, createTime.hashCode); - _$hash = $jc(_$hash, updateTime.hashCode); - _$hash = $jf(_$hash); - return _$hash; - } - - @override - String toString() { - return (newBuiltValueToStringHelper(r'Tasting') - ..add('name', name) - ..add('pours', pours) - ..add('createTime', createTime) - ..add('updateTime', updateTime)) - .toString(); - } -} - -class TastingBuilder implements Builder { - _$Tasting? _$v; - - String? _name; - String? get name => _$this._name; - set name(String? name) => _$this._name = name; - - int? _pours; - int? get pours => _$this._pours; - set pours(int? pours) => _$this._pours = pours; - - DateTime? _createTime; - DateTime? get createTime => _$this._createTime; - set createTime(DateTime? createTime) => _$this._createTime = createTime; - - DateTime? _updateTime; - DateTime? get updateTime => _$this._updateTime; - set updateTime(DateTime? updateTime) => _$this._updateTime = updateTime; - - TastingBuilder() { - Tasting._defaults(this); - } - - TastingBuilder get _$this { - final $v = _$v; - if ($v != null) { - _name = $v.name; - _pours = $v.pours; - _createTime = $v.createTime; - _updateTime = $v.updateTime; - _$v = null; - } - return this; - } - - @override - void replace(Tasting other) { - _$v = other as _$Tasting; - } - - @override - void update(void Function(TastingBuilder)? updates) { - if (updates != null) updates(this); - } - - @override - Tasting build() => _build(); - - _$Tasting _build() { - final _$result = _$v ?? - _$Tasting._( - name: name, - pours: pours, - createTime: createTime, - updateTime: updateTime, - ); - replace(_$result); - return _$result; - } -} - -// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/model/tasting_summary.dart b/packages/myfestival_client/lib/src/model/tasting_summary.dart deleted file mode 100644 index ead5ab2e..00000000 --- a/packages/myfestival_client/lib/src/model/tasting_summary.dart +++ /dev/null @@ -1,147 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'tasting_summary.g.dart'; - -/// Computed, read-only aggregate of how many callers have tried a drink. Useful for social discovery (\"N people have tried this\"). Keyed by drink under the festival, matching the ReviewSummary pattern. -/// -/// Properties: -/// * [name] - Resource name: festivals/{festival}/tastingSummaries/{drink}. -/// * [tasterCount] - Number of distinct callers who have logged a tasting for this drink. -/// * [totalPours] - Total pours logged across all callers. -@BuiltValue() -abstract class TastingSummary implements Built { - /// Resource name: festivals/{festival}/tastingSummaries/{drink}. - @BuiltValueField(wireName: r'name') - String? get name; - - /// Number of distinct callers who have logged a tasting for this drink. - @BuiltValueField(wireName: r'tasterCount') - int? get tasterCount; - - /// Total pours logged across all callers. - @BuiltValueField(wireName: r'totalPours') - int? get totalPours; - - TastingSummary._(); - - factory TastingSummary([void updates(TastingSummaryBuilder b)]) = _$TastingSummary; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(TastingSummaryBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$TastingSummarySerializer(); -} - -class _$TastingSummarySerializer implements PrimitiveSerializer { - @override - final Iterable types = const [TastingSummary, _$TastingSummary]; - - @override - final String wireName = r'TastingSummary'; - - Iterable _serializeProperties( - Serializers serializers, - TastingSummary object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); - } - if (object.tasterCount != null) { - yield r'tasterCount'; - yield serializers.serialize( - object.tasterCount, - specifiedType: const FullType(int), - ); - } - if (object.totalPours != null) { - yield r'totalPours'; - yield serializers.serialize( - object.totalPours, - specifiedType: const FullType(int), - ); - } - } - - @override - Object serialize( - Serializers serializers, - TastingSummary object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required TastingSummaryBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'name': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.name = valueDes; - break; - case r'tasterCount': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(int), - ) as int; - result.tasterCount = valueDes; - break; - case r'totalPours': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(int), - ) as int; - result.totalPours = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - TastingSummary deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = TastingSummaryBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/packages/myfestival_client/lib/src/model/tasting_summary.g.dart b/packages/myfestival_client/lib/src/model/tasting_summary.g.dart deleted file mode 100644 index a58990bb..00000000 --- a/packages/myfestival_client/lib/src/model/tasting_summary.g.dart +++ /dev/null @@ -1,114 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'tasting_summary.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -class _$TastingSummary extends TastingSummary { - @override - final String? name; - @override - final int? tasterCount; - @override - final int? totalPours; - - factory _$TastingSummary([void Function(TastingSummaryBuilder)? updates]) => - (TastingSummaryBuilder()..update(updates))._build(); - - _$TastingSummary._({this.name, this.tasterCount, this.totalPours}) - : super._(); - @override - TastingSummary rebuild(void Function(TastingSummaryBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - TastingSummaryBuilder toBuilder() => TastingSummaryBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is TastingSummary && - name == other.name && - tasterCount == other.tasterCount && - totalPours == other.totalPours; - } - - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, name.hashCode); - _$hash = $jc(_$hash, tasterCount.hashCode); - _$hash = $jc(_$hash, totalPours.hashCode); - _$hash = $jf(_$hash); - return _$hash; - } - - @override - String toString() { - return (newBuiltValueToStringHelper(r'TastingSummary') - ..add('name', name) - ..add('tasterCount', tasterCount) - ..add('totalPours', totalPours)) - .toString(); - } -} - -class TastingSummaryBuilder - implements Builder { - _$TastingSummary? _$v; - - String? _name; - String? get name => _$this._name; - set name(String? name) => _$this._name = name; - - int? _tasterCount; - int? get tasterCount => _$this._tasterCount; - set tasterCount(int? tasterCount) => _$this._tasterCount = tasterCount; - - int? _totalPours; - int? get totalPours => _$this._totalPours; - set totalPours(int? totalPours) => _$this._totalPours = totalPours; - - TastingSummaryBuilder() { - TastingSummary._defaults(this); - } - - TastingSummaryBuilder get _$this { - final $v = _$v; - if ($v != null) { - _name = $v.name; - _tasterCount = $v.tasterCount; - _totalPours = $v.totalPours; - _$v = null; - } - return this; - } - - @override - void replace(TastingSummary other) { - _$v = other as _$TastingSummary; - } - - @override - void update(void Function(TastingSummaryBuilder)? updates) { - if (updates != null) updates(this); - } - - @override - TastingSummary build() => _build(); - - _$TastingSummary _build() { - final _$result = _$v ?? - _$TastingSummary._( - name: name, - tasterCount: tasterCount, - totalPours: totalPours, - ); - replace(_$result); - return _$result; - } -} - -// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/lib/src/serializers.dart b/packages/myfestival_client/lib/src/serializers.dart deleted file mode 100644 index 84a986d8..00000000 --- a/packages/myfestival_client/lib/src/serializers.dart +++ /dev/null @@ -1,54 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_import - -import 'package:one_of_serializer/any_of_serializer.dart'; -import 'package:one_of_serializer/one_of_serializer.dart'; -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/json_object.dart'; -import 'package:built_value/serializer.dart'; -import 'package:built_value/standard_json_plugin.dart'; -import 'package:built_value/iso_8601_date_time_serializer.dart'; -import 'package:myfestival_client/src/date_serializer.dart'; -import 'package:myfestival_client/src/model/date.dart'; - -import 'package:myfestival_client/src/model/bookmark.dart'; -import 'package:myfestival_client/src/model/list_bookmarks_response.dart'; -import 'package:myfestival_client/src/model/list_notes_response.dart'; -import 'package:myfestival_client/src/model/list_review_summaries_response.dart'; -import 'package:myfestival_client/src/model/list_reviews_response.dart'; -import 'package:myfestival_client/src/model/list_tasting_summaries_response.dart'; -import 'package:myfestival_client/src/model/list_tastings_response.dart'; -import 'package:myfestival_client/src/model/note.dart'; -import 'package:myfestival_client/src/model/review.dart'; -import 'package:myfestival_client/src/model/review_summary.dart'; -import 'package:myfestival_client/src/model/tasting.dart'; -import 'package:myfestival_client/src/model/tasting_summary.dart'; - -part 'serializers.g.dart'; - -@SerializersFor([ - Bookmark, - ListBookmarksResponse, - ListNotesResponse, - ListReviewSummariesResponse, - ListReviewsResponse, - ListTastingSummariesResponse, - ListTastingsResponse, - Note, - Review, - ReviewSummary, - Tasting, - TastingSummary, -]) -Serializers serializers = (_$serializers.toBuilder() - ..add(const OneOfSerializer()) - ..add(const AnyOfSerializer()) - ..add(const DateSerializer()) - ..add(Iso8601DateTimeSerializer()) - ).build(); - -Serializers standardSerializers = - (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); diff --git a/packages/myfestival_client/lib/src/serializers.g.dart b/packages/myfestival_client/lib/src/serializers.g.dart deleted file mode 100644 index 0cabfe8f..00000000 --- a/packages/myfestival_client/lib/src/serializers.g.dart +++ /dev/null @@ -1,42 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'serializers.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -Serializers _$serializers = (Serializers().toBuilder() - ..add(Bookmark.serializer) - ..add(ListBookmarksResponse.serializer) - ..add(ListNotesResponse.serializer) - ..add(ListReviewSummariesResponse.serializer) - ..add(ListReviewsResponse.serializer) - ..add(ListTastingSummariesResponse.serializer) - ..add(ListTastingsResponse.serializer) - ..add(Note.serializer) - ..add(Review.serializer) - ..add(ReviewSummary.serializer) - ..add(Tasting.serializer) - ..add(TastingSummary.serializer) - ..addBuilderFactory( - const FullType(BuiltList, const [const FullType(Bookmark)]), - () => ListBuilder()) - ..addBuilderFactory( - const FullType(BuiltList, const [const FullType(Note)]), - () => ListBuilder()) - ..addBuilderFactory( - const FullType(BuiltList, const [const FullType(Review)]), - () => ListBuilder()) - ..addBuilderFactory( - const FullType(BuiltList, const [const FullType(ReviewSummary)]), - () => ListBuilder()) - ..addBuilderFactory( - const FullType(BuiltList, const [const FullType(Tasting)]), - () => ListBuilder()) - ..addBuilderFactory( - const FullType(BuiltList, const [const FullType(TastingSummary)]), - () => ListBuilder())) - .build(); - -// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/myfestival_client/pubspec.yaml b/packages/myfestival_client/pubspec.yaml deleted file mode 100644 index 32238175..00000000 --- a/packages/myfestival_client/pubspec.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: myfestival_client -version: 1.0.0 -description: OpenAPI API client -homepage: homepage - - -environment: - sdk: '>=2.18.0 <4.0.0' - -dependencies: - dio: '^5.7.0' - one_of: '>=1.5.0 <2.0.0' - one_of_serializer: '>=1.5.0 <2.0.0' - built_value: '>=8.4.0 <9.0.0' - built_collection: '>=5.1.1 <6.0.0' - -dev_dependencies: - built_value_generator: '>=8.4.0 <9.0.0' - build_runner: any - test: '^1.16.0' diff --git a/packages/myfestival_client/test/bookmark_test.dart b/packages/myfestival_client/test/bookmark_test.dart deleted file mode 100644 index b0728590..00000000 --- a/packages/myfestival_client/test/bookmark_test.dart +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:test/test.dart'; -import 'package:myfestival_client/myfestival_client.dart'; - -// tests for Bookmark -void main() { - final instance = BookmarkBuilder(); - // TODO add properties to the builder and call build() - - group(Bookmark, () { - // Resource name: festivals/{festival}/drinks/{drink}/bookmark. - // String name - test('to test the property `name`', () async { - // TODO - }); - - // When the bookmark was created. - // DateTime createTime - test('to test the property `createTime`', () async { - // TODO - }); - - }); -} diff --git a/packages/myfestival_client/test/list_bookmarks_response_test.dart b/packages/myfestival_client/test/list_bookmarks_response_test.dart deleted file mode 100644 index 1b611b5f..00000000 --- a/packages/myfestival_client/test/list_bookmarks_response_test.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:test/test.dart'; -import 'package:myfestival_client/myfestival_client.dart'; - -// tests for ListBookmarksResponse -void main() { - final instance = ListBookmarksResponseBuilder(); - // TODO add properties to the builder and call build() - - group(ListBookmarksResponse, () { - // The caller's bookmarks for this page, one per bookmarked drink. - // BuiltList bookmarks - test('to test the property `bookmarks`', () async { - // TODO - }); - - // Token for the next page; empty when there are no more results. - // String nextPageToken - test('to test the property `nextPageToken`', () async { - // TODO - }); - - // Total number of drinks the caller has bookmarked at this festival. - // int totalSize - test('to test the property `totalSize`', () async { - // TODO - }); - - }); -} diff --git a/packages/myfestival_client/test/list_notes_response_test.dart b/packages/myfestival_client/test/list_notes_response_test.dart deleted file mode 100644 index 27611daf..00000000 --- a/packages/myfestival_client/test/list_notes_response_test.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:test/test.dart'; -import 'package:myfestival_client/myfestival_client.dart'; - -// tests for ListNotesResponse -void main() { - final instance = ListNotesResponseBuilder(); - // TODO add properties to the builder and call build() - - group(ListNotesResponse, () { - // The caller's notes for this page, one per noted drink. - // BuiltList notes - test('to test the property `notes`', () async { - // TODO - }); - - // Token for the next page; empty when there are no more results. - // String nextPageToken - test('to test the property `nextPageToken`', () async { - // TODO - }); - - // Total number of drinks the caller has notes for at this festival. - // int totalSize - test('to test the property `totalSize`', () async { - // TODO - }); - - }); -} diff --git a/packages/myfestival_client/test/list_review_summaries_response_test.dart b/packages/myfestival_client/test/list_review_summaries_response_test.dart deleted file mode 100644 index 3b131273..00000000 --- a/packages/myfestival_client/test/list_review_summaries_response_test.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:test/test.dart'; -import 'package:myfestival_client/myfestival_client.dart'; - -// tests for ListReviewSummariesResponse -void main() { - final instance = ListReviewSummariesResponseBuilder(); - // TODO add properties to the builder and call build() - - group(ListReviewSummariesResponse, () { - // Aggregate review signals for this page, one per reviewed drink. - // BuiltList reviewSummaries - test('to test the property `reviewSummaries`', () async { - // TODO - }); - - // Token for the next page; empty when there are no more results. - // String nextPageToken - test('to test the property `nextPageToken`', () async { - // TODO - }); - - // Total number of drinks with at least one review at this festival. - // int totalSize - test('to test the property `totalSize`', () async { - // TODO - }); - - }); -} diff --git a/packages/myfestival_client/test/list_reviews_response_test.dart b/packages/myfestival_client/test/list_reviews_response_test.dart deleted file mode 100644 index 490a7fdd..00000000 --- a/packages/myfestival_client/test/list_reviews_response_test.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:test/test.dart'; -import 'package:myfestival_client/myfestival_client.dart'; - -// tests for ListReviewsResponse -void main() { - final instance = ListReviewsResponseBuilder(); - // TODO add properties to the builder and call build() - - group(ListReviewsResponse, () { - // The caller's reviews for this page, one per reviewed drink. - // BuiltList reviews - test('to test the property `reviews`', () async { - // TODO - }); - - // Token for the next page; empty when there are no more results. - // String nextPageToken - test('to test the property `nextPageToken`', () async { - // TODO - }); - - // Total number of drinks the caller has reviewed at this festival. - // int totalSize - test('to test the property `totalSize`', () async { - // TODO - }); - - }); -} diff --git a/packages/myfestival_client/test/list_tasting_summaries_response_test.dart b/packages/myfestival_client/test/list_tasting_summaries_response_test.dart deleted file mode 100644 index dd20d6ca..00000000 --- a/packages/myfestival_client/test/list_tasting_summaries_response_test.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:test/test.dart'; -import 'package:myfestival_client/myfestival_client.dart'; - -// tests for ListTastingSummariesResponse -void main() { - final instance = ListTastingSummariesResponseBuilder(); - // TODO add properties to the builder and call build() - - group(ListTastingSummariesResponse, () { - // Tasting counts for this page, one per tried drink. - // BuiltList tastingSummaries - test('to test the property `tastingSummaries`', () async { - // TODO - }); - - // Token for the next page; empty when there are no more results. - // String nextPageToken - test('to test the property `nextPageToken`', () async { - // TODO - }); - - // Total number of drinks tried by at least one caller at this festival. - // int totalSize - test('to test the property `totalSize`', () async { - // TODO - }); - - }); -} diff --git a/packages/myfestival_client/test/list_tastings_response_test.dart b/packages/myfestival_client/test/list_tastings_response_test.dart deleted file mode 100644 index 668627e4..00000000 --- a/packages/myfestival_client/test/list_tastings_response_test.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:test/test.dart'; -import 'package:myfestival_client/myfestival_client.dart'; - -// tests for ListTastingsResponse -void main() { - final instance = ListTastingsResponseBuilder(); - // TODO add properties to the builder and call build() - - group(ListTastingsResponse, () { - // The caller's tasting records for this page, one per tried drink. - // BuiltList tastings - test('to test the property `tastings`', () async { - // TODO - }); - - // Token for the next page; empty when there are no more results. - // String nextPageToken - test('to test the property `nextPageToken`', () async { - // TODO - }); - - // Total number of drinks the caller has tried at this festival. - // int totalSize - test('to test the property `totalSize`', () async { - // TODO - }); - - }); -} diff --git a/packages/myfestival_client/test/my_festival_service_api_test.dart b/packages/myfestival_client/test/my_festival_service_api_test.dart deleted file mode 100644 index 3882bfee..00000000 --- a/packages/myfestival_client/test/my_festival_service_api_test.dart +++ /dev/null @@ -1,151 +0,0 @@ -import 'package:test/test.dart'; -import 'package:myfestival_client/myfestival_client.dart'; - - -/// tests for MyFestivalServiceApi -void main() { - final instance = MyfestivalClient().getMyFestivalServiceApi(); - - group(MyFestivalServiceApi, () { - // Remove the caller's bookmark for a drink. - // - //Future myFestivalServiceDeleteBookmark(String festival, String drink) async - test('test myFestivalServiceDeleteBookmark', () async { - // TODO - }); - - // Remove the caller's tasting note for a drink. - // - //Future myFestivalServiceDeleteNote(String festival, String drink) async - test('test myFestivalServiceDeleteNote', () async { - // TODO - }); - - // Remove the caller's review for a drink. - // - //Future myFestivalServiceDeleteReview(String festival, String drink) async - test('test myFestivalServiceDeleteReview', () async { - // TODO - }); - - // Remove the caller's tasting record for a drink. - // - //Future myFestivalServiceDeleteTasting(String festival, String drink) async - test('test myFestivalServiceDeleteTasting', () async { - // TODO - }); - - // --- Bookmarks (caller-scoped singletons) --------------------------------- Get the caller's bookmark for a drink. - // - //Future myFestivalServiceGetBookmark(String festival, String drink) async - test('test myFestivalServiceGetBookmark', () async { - // TODO - }); - - // --- Tasting notes (caller-scoped singletons) ----------------------------- Get the caller's tasting note for a drink. - // - //Future myFestivalServiceGetNote(String festival, String drink) async - test('test myFestivalServiceGetNote', () async { - // TODO - }); - - // --- Personal reviews (caller-scoped singletons) -------------------------- Get the caller's review for a drink. - // - //Future myFestivalServiceGetReview(String festival, String drink) async - test('test myFestivalServiceGetReview', () async { - // TODO - }); - - // --- Aggregates (public, not caller-scoped) -------------------------------- Get the aggregate review signals for a single drink. - // - //Future myFestivalServiceGetReviewSummary(String festival, String reviewSummary) async - test('test myFestivalServiceGetReviewSummary', () async { - // TODO - }); - - // --- Tasting log (caller-scoped singletons) ------------------------------- Get the caller's tasting record for a drink. - // - //Future myFestivalServiceGetTasting(String festival, String drink) async - test('test myFestivalServiceGetTasting', () async { - // TODO - }); - - // Get tasting counts for a single drink. - // - //Future myFestivalServiceGetTastingSummary(String festival, String tastingSummary) async - test('test myFestivalServiceGetTastingSummary', () async { - // TODO - }); - - // List all drinks the caller has bookmarked at a festival. Intended for pre-loading \"my festival\" state on app open. - // - //Future myFestivalServiceListBookmarks(String festival, { int pageSize, String pageToken }) async - test('test myFestivalServiceListBookmarks', () async { - // TODO - }); - - // List all tasting notes the caller has written at a festival. - // - //Future myFestivalServiceListNotes(String festival, { int pageSize, String pageToken }) async - test('test myFestivalServiceListNotes', () async { - // TODO - }); - - // List aggregate review signals for every reviewed drink at a festival. - // - //Future myFestivalServiceListReviewSummaries(String festival, { int pageSize, String pageToken }) async - test('test myFestivalServiceListReviewSummaries', () async { - // TODO - }); - - // List all reviews the caller has left for drinks at a festival. Only the caller's own reviews are returned; caller identity is implicit in the auth context. Intended for pre-loading \"my festival\" state on app open. - // - //Future myFestivalServiceListReviews(String festival, { int pageSize, String pageToken }) async - test('test myFestivalServiceListReviews', () async { - // TODO - }); - - // List tasting counts for every tried drink at a festival. - // - //Future myFestivalServiceListTastingSummaries(String festival, { int pageSize, String pageToken }) async - test('test myFestivalServiceListTastingSummaries', () async { - // TODO - }); - - // List all tasting records the caller has logged at a festival. - // - //Future myFestivalServiceListTastings(String festival, { int pageSize, String pageToken }) async - test('test myFestivalServiceListTastings', () async { - // TODO - }); - - // Create or update the caller's bookmark for a drink (upsert). - // - //Future myFestivalServiceUpdateBookmark(String festival, String drink, Bookmark bookmark, { String updateMask }) async - test('test myFestivalServiceUpdateBookmark', () async { - // TODO - }); - - // Create or update the caller's tasting note for a drink (upsert). - // - //Future myFestivalServiceUpdateNote(String festival, String drink, Note note, { String updateMask }) async - test('test myFestivalServiceUpdateNote', () async { - // TODO - }); - - // Create or update the caller's review for a drink (upsert). Use `update_mask` to update a single signal (e.g. only `star_rating`) without clearing the other. - // - //Future myFestivalServiceUpdateReview(String festival, String drink, Review review, { String updateMask }) async - test('test myFestivalServiceUpdateReview', () async { - // TODO - }); - - // Create or update the caller's tasting record for a drink (upsert). Use `update_mask` with `pours` to increment the pour count without affecting other fields. - // - //Future myFestivalServiceUpdateTasting(String festival, String drink, Tasting tasting, { String updateMask }) async - test('test myFestivalServiceUpdateTasting', () async { - // TODO - }); - - }); -} diff --git a/packages/myfestival_client/test/note_test.dart b/packages/myfestival_client/test/note_test.dart deleted file mode 100644 index 42a37285..00000000 --- a/packages/myfestival_client/test/note_test.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:test/test.dart'; -import 'package:myfestival_client/myfestival_client.dart'; - -// tests for Note -void main() { - final instance = NoteBuilder(); - // TODO add properties to the builder and call build() - - group(Note, () { - // Resource name: festivals/{festival}/drinks/{drink}/note. - // String name - test('to test the property `name`', () async { - // TODO - }); - - // The caller's note text. Max 2000 Unicode characters. - // String content - test('to test the property `content`', () async { - // TODO - }); - - // When this note was last written. - // DateTime updateTime - test('to test the property `updateTime`', () async { - // TODO - }); - - }); -} diff --git a/packages/myfestival_client/test/review_summary_test.dart b/packages/myfestival_client/test/review_summary_test.dart deleted file mode 100644 index d7806d4d..00000000 --- a/packages/myfestival_client/test/review_summary_test.dart +++ /dev/null @@ -1,47 +0,0 @@ -import 'package:test/test.dart'; -import 'package:myfestival_client/myfestival_client.dart'; - -// tests for ReviewSummary -void main() { - final instance = ReviewSummaryBuilder(); - // TODO add properties to the builder and call build() - - group(ReviewSummary, () { - // Resource name: festivals/{festival}/reviewSummaries/{drink}. - // String name - test('to test the property `name`', () async { - // TODO - }); - - // Number of callers who have submitted a star rating. - // int ratingCount - test('to test the property `ratingCount`', () async { - // TODO - }); - - // Mean star rating across all callers (1.0–5.0); 0 when rating_count is 0. - // double averageRating - test('to test the property `averageRating`', () async { - // TODO - }); - - // Number of callers who have answered the \"would recommend\" question. - // int responseCount - test('to test the property `responseCount`', () async { - // TODO - }); - - // Number of callers who answered \"yes\" to the recommendation question. - // int recommendCount - test('to test the property `recommendCount`', () async { - // TODO - }); - - // Fraction of responses (0.0–1.0) that would recommend; 0 when response_count is 0. - // double recommendRate - test('to test the property `recommendRate`', () async { - // TODO - }); - - }); -} diff --git a/packages/myfestival_client/test/review_test.dart b/packages/myfestival_client/test/review_test.dart deleted file mode 100644 index 5c928931..00000000 --- a/packages/myfestival_client/test/review_test.dart +++ /dev/null @@ -1,35 +0,0 @@ -import 'package:test/test.dart'; -import 'package:myfestival_client/myfestival_client.dart'; - -// tests for Review -void main() { - final instance = ReviewBuilder(); - // TODO add properties to the builder and call build() - - group(Review, () { - // Resource name: festivals/{festival}/drinks/{drink}/review. - // String name - test('to test the property `name`', () async { - // TODO - }); - - // Star rating, 1–5 inclusive. Absent if the caller has not set a star rating. - // int starRating - test('to test the property `starRating`', () async { - // TODO - }); - - // Whether the caller would recommend this drink. Absent if not answered. - // bool wouldRecommend - test('to test the property `wouldRecommend`', () async { - // TODO - }); - - // When this review was last written. - // DateTime updateTime - test('to test the property `updateTime`', () async { - // TODO - }); - - }); -} diff --git a/packages/myfestival_client/test/tasting_summary_test.dart b/packages/myfestival_client/test/tasting_summary_test.dart deleted file mode 100644 index 914c4e44..00000000 --- a/packages/myfestival_client/test/tasting_summary_test.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:test/test.dart'; -import 'package:myfestival_client/myfestival_client.dart'; - -// tests for TastingSummary -void main() { - final instance = TastingSummaryBuilder(); - // TODO add properties to the builder and call build() - - group(TastingSummary, () { - // Resource name: festivals/{festival}/tastingSummaries/{drink}. - // String name - test('to test the property `name`', () async { - // TODO - }); - - // Number of distinct callers who have logged a tasting for this drink. - // int tasterCount - test('to test the property `tasterCount`', () async { - // TODO - }); - - // Total pours logged across all callers. - // int totalPours - test('to test the property `totalPours`', () async { - // TODO - }); - - }); -} diff --git a/packages/myfestival_client/test/tasting_test.dart b/packages/myfestival_client/test/tasting_test.dart deleted file mode 100644 index 9e7d6b01..00000000 --- a/packages/myfestival_client/test/tasting_test.dart +++ /dev/null @@ -1,35 +0,0 @@ -import 'package:test/test.dart'; -import 'package:myfestival_client/myfestival_client.dart'; - -// tests for Tasting -void main() { - final instance = TastingBuilder(); - // TODO add properties to the builder and call build() - - group(Tasting, () { - // Resource name: festivals/{festival}/drinks/{drink}/tasting. - // String name - test('to test the property `name`', () async { - // TODO - }); - - // How many times the caller has had this drink. Absent means one pour. Must be >= 1 when present. - // int pours - test('to test the property `pours`', () async { - // TODO - }); - - // When the caller first tried this drink. - // DateTime createTime - test('to test the property `createTime`', () async { - // TODO - }); - - // When this record was last updated. - // DateTime updateTime - test('to test the property `updateTime`', () async { - // TODO - }); - - }); -} diff --git a/pubspec.lock b/pubspec.lock index 52d1069a..787e8d7c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -217,22 +217,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.9" - dio: - dependency: transitive - description: - name: dio - sha256: aff32c08f92787a557dd5c0145ac91536481831a01b4648136373cddb0e64f8c - url: "https://pub.dev" - source: hosted - version: "5.9.2" - dio_web_adapter: - dependency: transitive - description: - name: dio_web_adapter - sha256: "2f9e64323a7c3c7ef69567d5c800424a11f8337b8b228bad02524c9fb3c1f340" - url: "https://pub.dev" - source: hosted - version: "2.1.2" fake_async: dependency: transitive description: @@ -583,13 +567,6 @@ packages: url: "https://pub.dev" source: hosted version: "5.7.0" - myfestival_client: - dependency: "direct main" - description: - path: "packages/myfestival_client" - relative: true - source: path - version: "1.0.0" nested: dependency: transitive description: @@ -606,22 +583,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.0" - one_of: - dependency: transitive - description: - name: one_of - sha256: "25fe0fcf181e761c6fcd604caf9d5fdf952321be17584ba81c72c06bdaa511f0" - url: "https://pub.dev" - source: hosted - version: "1.5.0" - one_of_serializer: - dependency: transitive - description: - name: one_of_serializer - sha256: "3f3dfb5c1578ba3afef1cb47fcc49e585e797af3f2b6c2cc7ed90aad0c5e7b83" - url: "https://pub.dev" - source: hosted - version: "1.5.0" package_config: dependency: transitive description: @@ -782,14 +743,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.0" - quiver: - dependency: transitive - description: - name: quiver - sha256: ea0b925899e64ecdfbf9c7becb60d5b50e706ade44a85b2363be2a22d88117d2 - url: "https://pub.dev" - source: hosted - version: "3.2.2" rxdart: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 5a854b72..2493856e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -25,8 +25,6 @@ dependencies: collection: ^1.18.0 go_router: ^17.3.0 google_fonts: ^8.1.0 - myfestival_client: - path: packages/myfestival_client dev_dependencies: flutter_test: From e3cca21e81adc393da67fbefde06d21354d856ba Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 13 Jun 2026 08:21:33 +0000 Subject: [PATCH 12/13] chore: gitignore cloudflare-worker/src/ (generated TS types) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit api-types.ts is generated from openapi.yaml via proto:clients:types. Same rationale as packages/ — commit the source spec, not the derived artifact. https://claude.ai/code/session_01WX7GbU19M9fh3tAfAxzeET --- cloudflare-worker/.gitignore | 3 + cloudflare-worker/src/api-types.ts | 1051 ---------------------------- 2 files changed, 3 insertions(+), 1051 deletions(-) delete mode 100644 cloudflare-worker/src/api-types.ts diff --git a/cloudflare-worker/.gitignore b/cloudflare-worker/.gitignore index 1c46170d..54b8e72e 100644 --- a/cloudflare-worker/.gitignore +++ b/cloudflare-worker/.gitignore @@ -1,6 +1,9 @@ # Generated during build - source is at data/festivals.json festivals.json +# Generated from proto via proto:clients:types — regenerate with: MISE_ENV=dev ./bin/mise run proto:clients:types +src/ + # Node.js node_modules/ diff --git a/cloudflare-worker/src/api-types.ts b/cloudflare-worker/src/api-types.ts deleted file mode 100644 index 260d7a0d..00000000 --- a/cloudflare-worker/src/api-types.ts +++ /dev/null @@ -1,1051 +0,0 @@ -/** - * This file was auto-generated by openapi-typescript. - * Do not make direct changes to the file. - */ - -export interface paths { - "/v1alpha/festivals/{festival}/bookmarks": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * @description List all drinks the caller has bookmarked at a festival. - * - * Intended for pre-loading "my festival" state on app open. - */ - get: operations["MyFestivalService_ListBookmarks"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1alpha/festivals/{festival}/drinks/{drink}/bookmark": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * @description --- Bookmarks (caller-scoped singletons) --------------------------------- - * Get the caller's bookmark for a drink. - */ - get: operations["MyFestivalService_GetBookmark"]; - put?: never; - post?: never; - /** @description Remove the caller's bookmark for a drink. */ - delete: operations["MyFestivalService_DeleteBookmark"]; - options?: never; - head?: never; - /** @description Create or update the caller's bookmark for a drink (upsert). */ - patch: operations["MyFestivalService_UpdateBookmark"]; - trace?: never; - }; - "/v1alpha/festivals/{festival}/drinks/{drink}/note": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * @description --- Tasting notes (caller-scoped singletons) ----------------------------- - * Get the caller's tasting note for a drink. - */ - get: operations["MyFestivalService_GetNote"]; - put?: never; - post?: never; - /** @description Remove the caller's tasting note for a drink. */ - delete: operations["MyFestivalService_DeleteNote"]; - options?: never; - head?: never; - /** @description Create or update the caller's tasting note for a drink (upsert). */ - patch: operations["MyFestivalService_UpdateNote"]; - trace?: never; - }; - "/v1alpha/festivals/{festival}/drinks/{drink}/review": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * @description --- Personal reviews (caller-scoped singletons) -------------------------- - * Get the caller's review for a drink. - */ - get: operations["MyFestivalService_GetReview"]; - put?: never; - post?: never; - /** @description Remove the caller's review for a drink. */ - delete: operations["MyFestivalService_DeleteReview"]; - options?: never; - head?: never; - /** - * @description Create or update the caller's review for a drink (upsert). - * - * Use `update_mask` to update a single signal (e.g. only `star_rating`) - * without clearing the other. - */ - patch: operations["MyFestivalService_UpdateReview"]; - trace?: never; - }; - "/v1alpha/festivals/{festival}/drinks/{drink}/tasting": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * @description --- Tasting log (caller-scoped singletons) ------------------------------- - * Get the caller's tasting record for a drink. - */ - get: operations["MyFestivalService_GetTasting"]; - put?: never; - post?: never; - /** @description Remove the caller's tasting record for a drink. */ - delete: operations["MyFestivalService_DeleteTasting"]; - options?: never; - head?: never; - /** - * @description Create or update the caller's tasting record for a drink (upsert). - * - * Use `update_mask` with `pours` to increment the pour count without - * affecting other fields. - */ - patch: operations["MyFestivalService_UpdateTasting"]; - trace?: never; - }; - "/v1alpha/festivals/{festival}/notes": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** @description List all tasting notes the caller has written at a festival. */ - get: operations["MyFestivalService_ListNotes"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1alpha/festivals/{festival}/reviewSummaries": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** @description List aggregate review signals for every reviewed drink at a festival. */ - get: operations["MyFestivalService_ListReviewSummaries"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1alpha/festivals/{festival}/reviewSummaries/{reviewSummary}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * @description --- Aggregates (public, not caller-scoped) -------------------------------- - * Get the aggregate review signals for a single drink. - */ - get: operations["MyFestivalService_GetReviewSummary"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1alpha/festivals/{festival}/reviews": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * @description List all reviews the caller has left for drinks at a festival. - * - * Only the caller's own reviews are returned; caller identity is implicit in - * the auth context. Intended for pre-loading "my festival" state on app open. - */ - get: operations["MyFestivalService_ListReviews"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1alpha/festivals/{festival}/tastingSummaries": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** @description List tasting counts for every tried drink at a festival. */ - get: operations["MyFestivalService_ListTastingSummaries"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1alpha/festivals/{festival}/tastingSummaries/{tastingSummary}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** @description Get tasting counts for a single drink. */ - get: operations["MyFestivalService_GetTastingSummary"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1alpha/festivals/{festival}/tastings": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** @description List all tasting records the caller has logged at a festival. */ - get: operations["MyFestivalService_ListTastings"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; -} -export type webhooks = Record; -export interface components { - schemas: { - /** - * @description A drink the caller has bookmarked at a festival. - * - * Singleton resource — one per (caller, drink). The resource's mere existence - * means the drink is bookmarked; deleting it removes the bookmark. The caller - * is implicit in the auth context. - */ - Bookmark: { - /** @description Resource name: festivals/{festival}/drinks/{drink}/bookmark. */ - name?: string; - /** - * Format: date-time - * @description When the bookmark was created. - */ - readonly createTime?: string; - }; - /** @description Response message for ListBookmarks. */ - ListBookmarksResponse: { - /** @description The caller's bookmarks for this page, one per bookmarked drink. */ - bookmarks?: components["schemas"]["Bookmark"][]; - /** @description Token for the next page; empty when there are no more results. */ - nextPageToken?: string; - /** - * Format: int32 - * @description Total number of drinks the caller has bookmarked at this festival. - */ - totalSize?: number; - }; - /** @description Response message for ListNotes. */ - ListNotesResponse: { - /** @description The caller's notes for this page, one per noted drink. */ - notes?: components["schemas"]["Note"][]; - /** @description Token for the next page; empty when there are no more results. */ - nextPageToken?: string; - /** - * Format: int32 - * @description Total number of drinks the caller has notes for at this festival. - */ - totalSize?: number; - }; - /** @description Response message for ListReviewSummaries. */ - ListReviewSummariesResponse: { - /** @description Aggregate review signals for this page, one per reviewed drink. */ - reviewSummaries?: components["schemas"]["ReviewSummary"][]; - /** @description Token for the next page; empty when there are no more results. */ - nextPageToken?: string; - /** - * Format: int32 - * @description Total number of drinks with at least one review at this festival. - */ - totalSize?: number; - }; - /** @description Response message for ListReviews. */ - ListReviewsResponse: { - /** @description The caller's reviews for this page, one per reviewed drink. */ - reviews?: components["schemas"]["Review"][]; - /** @description Token for the next page; empty when there are no more results. */ - nextPageToken?: string; - /** - * Format: int32 - * @description Total number of drinks the caller has reviewed at this festival. - */ - totalSize?: number; - }; - /** @description Response message for ListTastingSummaries. */ - ListTastingSummariesResponse: { - /** @description Tasting counts for this page, one per tried drink. */ - tastingSummaries?: components["schemas"]["TastingSummary"][]; - /** @description Token for the next page; empty when there are no more results. */ - nextPageToken?: string; - /** - * Format: int32 - * @description Total number of drinks tried by at least one caller at this festival. - */ - totalSize?: number; - }; - /** @description Response message for ListTastings. */ - ListTastingsResponse: { - /** @description The caller's tasting records for this page, one per tried drink. */ - tastings?: components["schemas"]["Tasting"][]; - /** @description Token for the next page; empty when there are no more results. */ - nextPageToken?: string; - /** - * Format: int32 - * @description Total number of drinks the caller has tried at this festival. - */ - totalSize?: number; - }; - /** - * @description The caller's free-text tasting note for one drink at one festival. - * - * Singleton resource — one per (caller, drink). The caller is implicit in the - * auth context. A note is independent of a Review: you can note without rating, - * or rate without noting. - */ - Note: { - /** @description Resource name: festivals/{festival}/drinks/{drink}/note. */ - name?: string; - /** @description The caller's note text. Max 2000 Unicode characters. */ - content: string; - /** - * Format: date-time - * @description When this note was last written. - */ - readonly updateTime?: string; - }; - /** - * @description The caller's review of one drink at one festival: a star rating (1-5) and/or - * a "would recommend" answer. - * - * Singleton resource — one per (caller, drink). The caller is implicit in the - * auth context; their identity never appears in the resource name, keeping - * device IDs private and making the sign-in upgrade transparent to clients. - * - * Both signals are optional and independent: a caller can rate without - * answering the recommendation question, or vice versa. - */ - Review: { - /** @description Resource name: festivals/{festival}/drinks/{drink}/review. */ - name?: string; - /** - * Format: int32 - * @description Star rating, 1–5 inclusive. Absent if the caller has not set a star rating. - */ - starRating?: number; - /** @description Whether the caller would recommend this drink. Absent if not answered. */ - wouldRecommend?: boolean; - /** - * Format: date-time - * @description When this review was last written. - */ - readonly updateTime?: string; - }; - /** - * @description Computed, read-only aggregate of all callers' reviews for one drink. - * - * Keyed by drink under the festival so the whole festival can be fetched in - * one paginated call for list/grid views. - */ - ReviewSummary: { - /** @description Resource name: festivals/{festival}/reviewSummaries/{drink}. */ - name?: string; - /** - * Format: int32 - * @description Number of callers who have submitted a star rating. - */ - readonly ratingCount?: number; - /** - * Format: double - * @description Mean star rating across all callers (1.0–5.0); 0 when rating_count is 0. - */ - readonly averageRating?: number; - /** - * Format: int32 - * @description Number of callers who have answered the "would recommend" question. - */ - readonly responseCount?: number; - /** - * Format: int32 - * @description Number of callers who answered "yes" to the recommendation question. - */ - readonly recommendCount?: number; - /** - * Format: double - * @description Fraction of responses (0.0–1.0) that would recommend; 0 when - * response_count is 0. - */ - readonly recommendRate?: number; - }; - /** - * @description A record that the caller has tried a drink at a festival. - * - * Singleton resource — one per (caller, drink). The caller is implicit in the - * auth context. `pours` tracks how many times the caller has had this drink at - * the festival (e.g. returned for a second half-pint); absent means one pour. - */ - Tasting: { - /** @description Resource name: festivals/{festival}/drinks/{drink}/tasting. */ - name?: string; - /** - * Format: int32 - * @description How many times the caller has had this drink. Absent means one pour. - * Must be >= 1 when present. - */ - pours?: number; - /** - * Format: date-time - * @description When the caller first tried this drink. - */ - readonly createTime?: string; - /** - * Format: date-time - * @description When this record was last updated. - */ - readonly updateTime?: string; - }; - /** - * @description Computed, read-only aggregate of how many callers have tried a drink. - * - * Useful for social discovery ("N people have tried this"). Keyed by drink - * under the festival, matching the ReviewSummary pattern. - */ - TastingSummary: { - /** @description Resource name: festivals/{festival}/tastingSummaries/{drink}. */ - name?: string; - /** - * Format: int32 - * @description Number of distinct callers who have logged a tasting for this drink. - */ - readonly tasterCount?: number; - /** - * Format: int32 - * @description Total pours logged across all callers. - */ - readonly totalPours?: number; - }; - }; - responses: never; - parameters: never; - requestBodies: never; - headers: never; - pathItems: never; -} -export type $defs = Record; -export interface operations { - MyFestivalService_ListBookmarks: { - parameters: { - query?: { - /** - * @description Maximum number of bookmarks to return. The server default returns all of - * the caller's bookmarks for the festival in a single page (festival drink - * counts are bounded). Set explicitly to paginate. - */ - pageSize?: number; - /** @description Page token from a previous ListBookmarks response. */ - pageToken?: string; - }; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ListBookmarksResponse"]; - }; - }; - }; - }; - MyFestivalService_GetBookmark: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - /** @description The drink id. */ - drink: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Bookmark"]; - }; - }; - }; - }; - MyFestivalService_DeleteBookmark: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - /** @description The drink id. */ - drink: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; - }; - MyFestivalService_UpdateBookmark: { - parameters: { - query?: { - /** @description Fields to update. Omit to replace all writable fields. */ - updateMask?: string; - }; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - /** @description The drink id. */ - drink: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["Bookmark"]; - }; - }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Bookmark"]; - }; - }; - }; - }; - MyFestivalService_GetNote: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - /** @description The drink id. */ - drink: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Note"]; - }; - }; - }; - }; - MyFestivalService_DeleteNote: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - /** @description The drink id. */ - drink: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; - }; - MyFestivalService_UpdateNote: { - parameters: { - query?: { - /** @description Fields to update. Omit to replace all writable fields. */ - updateMask?: string; - }; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - /** @description The drink id. */ - drink: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["Note"]; - }; - }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Note"]; - }; - }; - }; - }; - MyFestivalService_GetReview: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - /** @description The drink id. */ - drink: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Review"]; - }; - }; - }; - }; - MyFestivalService_DeleteReview: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - /** @description The drink id. */ - drink: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; - }; - MyFestivalService_UpdateReview: { - parameters: { - query?: { - /** - * @description Fields to update. Omit to replace all writable fields. Specify - * `star_rating` or `would_recommend` individually to update one signal - * without affecting the other. - */ - updateMask?: string; - }; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - /** @description The drink id. */ - drink: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["Review"]; - }; - }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Review"]; - }; - }; - }; - }; - MyFestivalService_GetTasting: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - /** @description The drink id. */ - drink: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Tasting"]; - }; - }; - }; - }; - MyFestivalService_DeleteTasting: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - /** @description The drink id. */ - drink: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; - }; - MyFestivalService_UpdateTasting: { - parameters: { - query?: { - /** - * @description Fields to update. Omit to replace all writable fields. Specify `pours` - * to update the pour count without affecting other fields. - */ - updateMask?: string; - }; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - /** @description The drink id. */ - drink: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["Tasting"]; - }; - }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Tasting"]; - }; - }; - }; - }; - MyFestivalService_ListNotes: { - parameters: { - query?: { - /** - * @description Maximum number of notes to return. The server default returns all of the - * caller's notes for the festival in a single page (festival drink counts - * are bounded). Set explicitly to paginate. - */ - pageSize?: number; - /** @description Page token from a previous ListNotes response. */ - pageToken?: string; - }; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ListNotesResponse"]; - }; - }; - }; - }; - MyFestivalService_ListReviewSummaries: { - parameters: { - query?: { - /** - * @description Maximum number of summaries to return. The server default returns all - * summaries for the festival in a single page (drink counts are bounded). - * Set explicitly to paginate. - */ - pageSize?: number; - /** @description Page token from a previous ListReviewSummaries response. */ - pageToken?: string; - }; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ListReviewSummariesResponse"]; - }; - }; - }; - }; - MyFestivalService_GetReviewSummary: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - /** @description The reviewSummary id. */ - reviewSummary: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ReviewSummary"]; - }; - }; - }; - }; - MyFestivalService_ListReviews: { - parameters: { - query?: { - /** - * @description Maximum number of reviews to return. The server default returns all of the - * caller's reviews for the festival in a single page (festival drink counts - * are bounded). Set explicitly to paginate. - */ - pageSize?: number; - /** @description Page token from a previous ListReviews response. */ - pageToken?: string; - }; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ListReviewsResponse"]; - }; - }; - }; - }; - MyFestivalService_ListTastingSummaries: { - parameters: { - query?: { - /** - * @description Maximum number of summaries to return. The server default returns all - * summaries for the festival in a single page (drink counts are bounded). - * Set explicitly to paginate. - */ - pageSize?: number; - /** @description Page token from a previous ListTastingSummaries response. */ - pageToken?: string; - }; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ListTastingSummariesResponse"]; - }; - }; - }; - }; - MyFestivalService_GetTastingSummary: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - /** @description The tastingSummary id. */ - tastingSummary: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["TastingSummary"]; - }; - }; - }; - }; - MyFestivalService_ListTastings: { - parameters: { - query?: { - /** - * @description Maximum number of tastings to return. The server default returns all of - * the caller's tastings for the festival in a single page (festival drink - * counts are bounded). Set explicitly to paginate. - */ - pageSize?: number; - /** @description Page token from a previous ListTastings response. */ - pageToken?: string; - }; - header?: never; - path: { - /** @description The festival id. */ - festival: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ListTastingsResponse"]; - }; - }; - }; - }; -} From 4f6b6ea4dd692ee1239fe8ffcbf301352f984ac9 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 13 Jun 2026 08:23:44 +0000 Subject: [PATCH 13/13] chore: gitignore docs/code/api/openapi/ (generated from proto) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit openapi.yaml is derived from the proto files via buf generate. No generated artifacts committed — proto files are the source of truth. Regenerate with: MISE_ENV=dev ./bin/mise run proto:generate https://claude.ai/code/session_01WX7GbU19M9fh3tAfAxzeET --- docs/code/api/.gitignore | 2 + docs/code/api/openapi/openapi.yaml | 899 ----------------------------- 2 files changed, 2 insertions(+), 899 deletions(-) create mode 100644 docs/code/api/.gitignore delete mode 100644 docs/code/api/openapi/openapi.yaml diff --git a/docs/code/api/.gitignore b/docs/code/api/.gitignore new file mode 100644 index 00000000..db81ad51 --- /dev/null +++ b/docs/code/api/.gitignore @@ -0,0 +1,2 @@ +# Generated from proto via proto:generate — regenerate with: MISE_ENV=dev ./bin/mise run proto:generate +openapi/ diff --git a/docs/code/api/openapi/openapi.yaml b/docs/code/api/openapi/openapi.yaml deleted file mode 100644 index f6fafaee..00000000 --- a/docs/code/api/openapi/openapi.yaml +++ /dev/null @@ -1,899 +0,0 @@ -# Generated with protoc-gen-openapi -# https://github.com/google/gnostic/tree/master/cmd/protoc-gen-openapi - -openapi: 3.0.3 -info: - title: MyFestivalService API - description: |- - Stores each caller's personal festival state (bookmarks, notes, tastings, - reviews) and serves back bucket-scoped aggregates. Writes are local-first on - the client; this service holds the shared, cross-device state. - - All personal resources are singleton resources — one per (caller, drink). - The caller's identity is resolved from the auth context; it never appears in - resource names, keeping device IDs private and making the sign-in upgrade - transparent to existing clients. - version: 0.0.1 -servers: - - url: https://api.cambeerfestival.app -paths: - /v1alpha/festivals/{festival}/bookmarks: - get: - tags: - - MyFestivalService - description: |- - List all drinks the caller has bookmarked at a festival. - - Intended for pre-loading "my festival" state on app open. - operationId: MyFestivalService_ListBookmarks - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: pageSize - in: query - description: |- - Maximum number of bookmarks to return. The server default returns all of - the caller's bookmarks for the festival in a single page (festival drink - counts are bounded). Set explicitly to paginate. - schema: - type: integer - format: int32 - - name: pageToken - in: query - description: Page token from a previous ListBookmarks response. - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListBookmarksResponse' - /v1alpha/festivals/{festival}/drinks/{drink}/bookmark: - get: - tags: - - MyFestivalService - description: |- - --- Bookmarks (caller-scoped singletons) --------------------------------- - Get the caller's bookmark for a drink. - operationId: MyFestivalService_GetBookmark - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: drink - in: path - description: The drink id. - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Bookmark' - delete: - tags: - - MyFestivalService - description: Remove the caller's bookmark for a drink. - operationId: MyFestivalService_DeleteBookmark - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: drink - in: path - description: The drink id. - required: true - schema: - type: string - responses: - "200": - description: OK - content: {} - patch: - tags: - - MyFestivalService - description: Create or update the caller's bookmark for a drink (upsert). - operationId: MyFestivalService_UpdateBookmark - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: drink - in: path - description: The drink id. - required: true - schema: - type: string - - name: updateMask - in: query - description: Fields to update. Omit to replace all writable fields. - schema: - type: string - format: field-mask - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Bookmark' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Bookmark' - /v1alpha/festivals/{festival}/drinks/{drink}/note: - get: - tags: - - MyFestivalService - description: |- - --- Tasting notes (caller-scoped singletons) ----------------------------- - Get the caller's tasting note for a drink. - operationId: MyFestivalService_GetNote - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: drink - in: path - description: The drink id. - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Note' - delete: - tags: - - MyFestivalService - description: Remove the caller's tasting note for a drink. - operationId: MyFestivalService_DeleteNote - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: drink - in: path - description: The drink id. - required: true - schema: - type: string - responses: - "200": - description: OK - content: {} - patch: - tags: - - MyFestivalService - description: Create or update the caller's tasting note for a drink (upsert). - operationId: MyFestivalService_UpdateNote - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: drink - in: path - description: The drink id. - required: true - schema: - type: string - - name: updateMask - in: query - description: Fields to update. Omit to replace all writable fields. - schema: - type: string - format: field-mask - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Note' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Note' - /v1alpha/festivals/{festival}/drinks/{drink}/review: - get: - tags: - - MyFestivalService - description: |- - --- Personal reviews (caller-scoped singletons) -------------------------- - Get the caller's review for a drink. - operationId: MyFestivalService_GetReview - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: drink - in: path - description: The drink id. - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Review' - delete: - tags: - - MyFestivalService - description: Remove the caller's review for a drink. - operationId: MyFestivalService_DeleteReview - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: drink - in: path - description: The drink id. - required: true - schema: - type: string - responses: - "200": - description: OK - content: {} - patch: - tags: - - MyFestivalService - description: |- - Create or update the caller's review for a drink (upsert). - - Use `update_mask` to update a single signal (e.g. only `star_rating`) - without clearing the other. - operationId: MyFestivalService_UpdateReview - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: drink - in: path - description: The drink id. - required: true - schema: - type: string - - name: updateMask - in: query - description: |- - Fields to update. Omit to replace all writable fields. Specify - `star_rating` or `would_recommend` individually to update one signal - without affecting the other. - schema: - type: string - format: field-mask - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Review' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Review' - /v1alpha/festivals/{festival}/drinks/{drink}/tasting: - get: - tags: - - MyFestivalService - description: |- - --- Tasting log (caller-scoped singletons) ------------------------------- - Get the caller's tasting record for a drink. - operationId: MyFestivalService_GetTasting - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: drink - in: path - description: The drink id. - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Tasting' - delete: - tags: - - MyFestivalService - description: Remove the caller's tasting record for a drink. - operationId: MyFestivalService_DeleteTasting - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: drink - in: path - description: The drink id. - required: true - schema: - type: string - responses: - "200": - description: OK - content: {} - patch: - tags: - - MyFestivalService - description: |- - Create or update the caller's tasting record for a drink (upsert). - - Use `update_mask` with `pours` to increment the pour count without - affecting other fields. - operationId: MyFestivalService_UpdateTasting - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: drink - in: path - description: The drink id. - required: true - schema: - type: string - - name: updateMask - in: query - description: |- - Fields to update. Omit to replace all writable fields. Specify `pours` - to update the pour count without affecting other fields. - schema: - type: string - format: field-mask - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Tasting' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Tasting' - /v1alpha/festivals/{festival}/notes: - get: - tags: - - MyFestivalService - description: List all tasting notes the caller has written at a festival. - operationId: MyFestivalService_ListNotes - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: pageSize - in: query - description: |- - Maximum number of notes to return. The server default returns all of the - caller's notes for the festival in a single page (festival drink counts - are bounded). Set explicitly to paginate. - schema: - type: integer - format: int32 - - name: pageToken - in: query - description: Page token from a previous ListNotes response. - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListNotesResponse' - /v1alpha/festivals/{festival}/reviewSummaries: - get: - tags: - - MyFestivalService - description: List aggregate review signals for every reviewed drink at a festival. - operationId: MyFestivalService_ListReviewSummaries - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: pageSize - in: query - description: |- - Maximum number of summaries to return. The server default returns all - summaries for the festival in a single page (drink counts are bounded). - Set explicitly to paginate. - schema: - type: integer - format: int32 - - name: pageToken - in: query - description: Page token from a previous ListReviewSummaries response. - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListReviewSummariesResponse' - /v1alpha/festivals/{festival}/reviewSummaries/{reviewSummary}: - get: - tags: - - MyFestivalService - description: |- - --- Aggregates (public, not caller-scoped) -------------------------------- - Get the aggregate review signals for a single drink. - operationId: MyFestivalService_GetReviewSummary - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: reviewSummary - in: path - description: The reviewSummary id. - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ReviewSummary' - /v1alpha/festivals/{festival}/reviews: - get: - tags: - - MyFestivalService - description: |- - List all reviews the caller has left for drinks at a festival. - - Only the caller's own reviews are returned; caller identity is implicit in - the auth context. Intended for pre-loading "my festival" state on app open. - operationId: MyFestivalService_ListReviews - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: pageSize - in: query - description: |- - Maximum number of reviews to return. The server default returns all of the - caller's reviews for the festival in a single page (festival drink counts - are bounded). Set explicitly to paginate. - schema: - type: integer - format: int32 - - name: pageToken - in: query - description: Page token from a previous ListReviews response. - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListReviewsResponse' - /v1alpha/festivals/{festival}/tastingSummaries: - get: - tags: - - MyFestivalService - description: List tasting counts for every tried drink at a festival. - operationId: MyFestivalService_ListTastingSummaries - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: pageSize - in: query - description: |- - Maximum number of summaries to return. The server default returns all - summaries for the festival in a single page (drink counts are bounded). - Set explicitly to paginate. - schema: - type: integer - format: int32 - - name: pageToken - in: query - description: Page token from a previous ListTastingSummaries response. - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListTastingSummariesResponse' - /v1alpha/festivals/{festival}/tastingSummaries/{tastingSummary}: - get: - tags: - - MyFestivalService - description: Get tasting counts for a single drink. - operationId: MyFestivalService_GetTastingSummary - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: tastingSummary - in: path - description: The tastingSummary id. - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/TastingSummary' - /v1alpha/festivals/{festival}/tastings: - get: - tags: - - MyFestivalService - description: List all tasting records the caller has logged at a festival. - operationId: MyFestivalService_ListTastings - parameters: - - name: festival - in: path - description: The festival id. - required: true - schema: - type: string - - name: pageSize - in: query - description: |- - Maximum number of tastings to return. The server default returns all of - the caller's tastings for the festival in a single page (festival drink - counts are bounded). Set explicitly to paginate. - schema: - type: integer - format: int32 - - name: pageToken - in: query - description: Page token from a previous ListTastings response. - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListTastingsResponse' -components: - schemas: - Bookmark: - type: object - properties: - name: - type: string - description: 'Resource name: festivals/{festival}/drinks/{drink}/bookmark.' - createTime: - readOnly: true - type: string - description: When the bookmark was created. - format: date-time - description: |- - A drink the caller has bookmarked at a festival. - - Singleton resource — one per (caller, drink). The resource's mere existence - means the drink is bookmarked; deleting it removes the bookmark. The caller - is implicit in the auth context. - ListBookmarksResponse: - type: object - properties: - bookmarks: - type: array - items: - $ref: '#/components/schemas/Bookmark' - description: The caller's bookmarks for this page, one per bookmarked drink. - nextPageToken: - type: string - description: Token for the next page; empty when there are no more results. - totalSize: - type: integer - description: Total number of drinks the caller has bookmarked at this festival. - format: int32 - description: Response message for ListBookmarks. - ListNotesResponse: - type: object - properties: - notes: - type: array - items: - $ref: '#/components/schemas/Note' - description: The caller's notes for this page, one per noted drink. - nextPageToken: - type: string - description: Token for the next page; empty when there are no more results. - totalSize: - type: integer - description: Total number of drinks the caller has notes for at this festival. - format: int32 - description: Response message for ListNotes. - ListReviewSummariesResponse: - type: object - properties: - reviewSummaries: - type: array - items: - $ref: '#/components/schemas/ReviewSummary' - description: Aggregate review signals for this page, one per reviewed drink. - nextPageToken: - type: string - description: Token for the next page; empty when there are no more results. - totalSize: - type: integer - description: Total number of drinks with at least one review at this festival. - format: int32 - description: Response message for ListReviewSummaries. - ListReviewsResponse: - type: object - properties: - reviews: - type: array - items: - $ref: '#/components/schemas/Review' - description: The caller's reviews for this page, one per reviewed drink. - nextPageToken: - type: string - description: Token for the next page; empty when there are no more results. - totalSize: - type: integer - description: Total number of drinks the caller has reviewed at this festival. - format: int32 - description: Response message for ListReviews. - ListTastingSummariesResponse: - type: object - properties: - tastingSummaries: - type: array - items: - $ref: '#/components/schemas/TastingSummary' - description: Tasting counts for this page, one per tried drink. - nextPageToken: - type: string - description: Token for the next page; empty when there are no more results. - totalSize: - type: integer - description: Total number of drinks tried by at least one caller at this festival. - format: int32 - description: Response message for ListTastingSummaries. - ListTastingsResponse: - type: object - properties: - tastings: - type: array - items: - $ref: '#/components/schemas/Tasting' - description: The caller's tasting records for this page, one per tried drink. - nextPageToken: - type: string - description: Token for the next page; empty when there are no more results. - totalSize: - type: integer - description: Total number of drinks the caller has tried at this festival. - format: int32 - description: Response message for ListTastings. - Note: - required: - - content - type: object - properties: - name: - type: string - description: 'Resource name: festivals/{festival}/drinks/{drink}/note.' - content: - type: string - description: The caller's note text. Max 2000 Unicode characters. - updateTime: - readOnly: true - type: string - description: When this note was last written. - format: date-time - description: |- - The caller's free-text tasting note for one drink at one festival. - - Singleton resource — one per (caller, drink). The caller is implicit in the - auth context. A note is independent of a Review: you can note without rating, - or rate without noting. - Review: - type: object - properties: - name: - type: string - description: 'Resource name: festivals/{festival}/drinks/{drink}/review.' - starRating: - type: integer - description: Star rating, 1–5 inclusive. Absent if the caller has not set a star rating. - format: int32 - wouldRecommend: - type: boolean - description: Whether the caller would recommend this drink. Absent if not answered. - updateTime: - readOnly: true - type: string - description: When this review was last written. - format: date-time - description: |- - The caller's review of one drink at one festival: a star rating (1-5) and/or - a "would recommend" answer. - - Singleton resource — one per (caller, drink). The caller is implicit in the - auth context; their identity never appears in the resource name, keeping - device IDs private and making the sign-in upgrade transparent to clients. - - Both signals are optional and independent: a caller can rate without - answering the recommendation question, or vice versa. - ReviewSummary: - type: object - properties: - name: - type: string - description: 'Resource name: festivals/{festival}/reviewSummaries/{drink}.' - ratingCount: - readOnly: true - type: integer - description: Number of callers who have submitted a star rating. - format: int32 - averageRating: - readOnly: true - type: number - description: Mean star rating across all callers (1.0–5.0); 0 when rating_count is 0. - format: double - responseCount: - readOnly: true - type: integer - description: Number of callers who have answered the "would recommend" question. - format: int32 - recommendCount: - readOnly: true - type: integer - description: Number of callers who answered "yes" to the recommendation question. - format: int32 - recommendRate: - readOnly: true - type: number - description: |- - Fraction of responses (0.0–1.0) that would recommend; 0 when - response_count is 0. - format: double - description: |- - Computed, read-only aggregate of all callers' reviews for one drink. - - Keyed by drink under the festival so the whole festival can be fetched in - one paginated call for list/grid views. - Tasting: - type: object - properties: - name: - type: string - description: 'Resource name: festivals/{festival}/drinks/{drink}/tasting.' - pours: - type: integer - description: |- - How many times the caller has had this drink. Absent means one pour. - Must be >= 1 when present. - format: int32 - createTime: - readOnly: true - type: string - description: When the caller first tried this drink. - format: date-time - updateTime: - readOnly: true - type: string - description: When this record was last updated. - format: date-time - description: |- - A record that the caller has tried a drink at a festival. - - Singleton resource — one per (caller, drink). The caller is implicit in the - auth context. `pours` tracks how many times the caller has had this drink at - the festival (e.g. returned for a second half-pint); absent means one pour. - TastingSummary: - type: object - properties: - name: - type: string - description: 'Resource name: festivals/{festival}/tastingSummaries/{drink}.' - tasterCount: - readOnly: true - type: integer - description: Number of distinct callers who have logged a tasting for this drink. - format: int32 - totalPours: - readOnly: true - type: integer - description: Total pours logged across all callers. - format: int32 - description: |- - Computed, read-only aggregate of how many callers have tried a drink. - - Useful for social discovery ("N people have tried this"). Keyed by drink - under the festival, matching the ReviewSummary pattern. -tags: - - name: MyFestivalService