···11+---
22+applyTo: "lib/api.dart"
33+---
44+55+# Copilot Instructions: Generate Typed Dart API Client for Grain Social Endpoints
66+77+## Goal
88+99+Generate a Dart API client for the Grain social endpoints, using the lexicon
1010+JSON files in `lexicons/social/grain` and its subfolders. Each endpoint should
1111+have:
1212+1313+- Typed request and response models
1414+- API methods with correct parameters and return types
1515+- Documentation from the lexicon descriptions
1616+1717+## Instructions for Copilot
1818+1919+1. **For each lexicon JSON file:**
2020+ - Parse the endpoint definition (`id`, `type`, `description`,
2121+ `parameters`/`input`, `output`).
2222+ - Generate a Dart class for request parameters/input.
2323+ - Generate a Dart class for response/output.
2424+ - Use the [freezed](https://pub.dev/packages/freezed) package to generate an
2525+ immutable model for each response type.
2626+ - Each model class should be created in a separate file in
2727+ `models/procedures`.
2828+ - Create a Dart method for the endpoint, with correct types and
2929+ documentation.
3030+ - Each API method should:
3131+ - Accept an `apiUrl` parameter as a prefix for requests (e.g.,
3232+ `$apiUrl/xrpc/${id}`).
3333+ - Pass the API token in the `Authorization` header for all requests.
3434+ - Use the endpoint URL format `/xrpc/${id}` (e.g.,
3535+ `/xrpc/social.grain.actor.getProfile`).
3636+3737+2. **Type Mapping:**
3838+ - JSON `string` โ Dart `String`
3939+ - JSON `object` โ Dart class
4040+ - JSON `array` โ Dart `List<T>`
4141+ - JSON `integer` โ Dart `int`
4242+ - JSON `boolean` โ Dart `bool`
4343+ - JSON `*/*` (binary) โ Dart `Uint8List` or `List<int>`
4444+4545+3. **API Method Example:**
4646+ ```dart
4747+ /// Get detailed profile view of an actor.
4848+ Future<ProfileViewDetailed> getProfile(String actor);
4949+5050+ /// Create a comment.
5151+ Future<CommentResponse> createComment(CreateCommentRequest request);
5252+5353+ /// Create a follow relationship.
5454+ Future<FollowResponse> createFollow(String subject);
5555+5656+ /// Create a photo.
5757+ Future<PhotoResponse> createPhoto(Uint8List photoData);
5858+ ```
5959+6060+4. **Documentation:**
6161+ - Use the `description` field from the lexicon for method/class docs.
6262+6363+5. **Error Handling:**
6464+ - Generate error classes/types for API errors.
6565+6666+6. **Authentication:**
6767+ - Mark endpoints that require auth.
6868+6969+## Reference
7070+7171+Use all JSON files in `lexicons/social/grain` and subfolders. For each endpoint,
7272+use the schema references for response types if available.
7373+7474+## Example Endpoints
7575+7676+### Get Actor Profile
7777+7878+- **ID:** `social.grain.actor.getProfile`
7979+- **Type:** Query
8080+- **Description:** Get detailed profile view of an actor. Does not require auth,
8181+ but contains relevant metadata with auth.
8282+- **Parameters:** `actor` (string, at-identifier)
8383+- **Response:** JSON, schema: `social.grain.actor.defs#profileViewDetailed`
···11+{
22+ "lexicon": 1,
33+ "id": "app.bsky.feed.postgate",
44+ "defs": {
55+ "main": {
66+ "key": "tid",
77+ "type": "record",
88+ "record": {
99+ "type": "object",
1010+ "required": [
1111+ "post",
1212+ "createdAt"
1313+ ],
1414+ "properties": {
1515+ "post": {
1616+ "type": "string",
1717+ "format": "at-uri",
1818+ "description": "Reference (AT-URI) to the post record."
1919+ },
2020+ "createdAt": {
2121+ "type": "string",
2222+ "format": "datetime"
2323+ },
2424+ "embeddingRules": {
2525+ "type": "array",
2626+ "items": {
2727+ "refs": [
2828+ "#disableRule"
2929+ ],
3030+ "type": "union"
3131+ },
3232+ "maxLength": 5,
3333+ "description": "List of rules defining who can embed this post. If value is an empty array or is undefined, no particular rules apply and anyone can embed."
3434+ },
3535+ "detachedEmbeddingUris": {
3636+ "type": "array",
3737+ "items": {
3838+ "type": "string",
3939+ "format": "at-uri"
4040+ },
4141+ "maxLength": 50,
4242+ "description": "List of AT-URIs embedding this post that the author has detached from."
4343+ }
4444+ }
4545+ },
4646+ "description": "Record defining interaction rules for a post. The record key (rkey) of the postgate record must match the record key of the post, and that record must be in the same repository."
4747+ },
4848+ "disableRule": {
4949+ "type": "object",
5050+ "properties": {},
5151+ "description": "Disables embedding of this post."
5252+ }
5353+ }
5454+}
+80
lexicons/app/bsky/feed/threadgate.json
···11+{
22+ "lexicon": 1,
33+ "id": "app.bsky.feed.threadgate",
44+ "defs": {
55+ "main": {
66+ "key": "tid",
77+ "type": "record",
88+ "record": {
99+ "type": "object",
1010+ "required": [
1111+ "post",
1212+ "createdAt"
1313+ ],
1414+ "properties": {
1515+ "post": {
1616+ "type": "string",
1717+ "format": "at-uri",
1818+ "description": "Reference (AT-URI) to the post record."
1919+ },
2020+ "allow": {
2121+ "type": "array",
2222+ "items": {
2323+ "refs": [
2424+ "#mentionRule",
2525+ "#followerRule",
2626+ "#followingRule",
2727+ "#listRule"
2828+ ],
2929+ "type": "union"
3030+ },
3131+ "maxLength": 5,
3232+ "description": "List of rules defining who can reply to this post. If value is an empty array, no one can reply. If value is undefined, anyone can reply."
3333+ },
3434+ "createdAt": {
3535+ "type": "string",
3636+ "format": "datetime"
3737+ },
3838+ "hiddenReplies": {
3939+ "type": "array",
4040+ "items": {
4141+ "type": "string",
4242+ "format": "at-uri"
4343+ },
4444+ "maxLength": 50,
4545+ "description": "List of hidden reply URIs."
4646+ }
4747+ }
4848+ },
4949+ "description": "Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository."
5050+ },
5151+ "listRule": {
5252+ "type": "object",
5353+ "required": [
5454+ "list"
5555+ ],
5656+ "properties": {
5757+ "list": {
5858+ "type": "string",
5959+ "format": "at-uri"
6060+ }
6161+ },
6262+ "description": "Allow replies from actors on a list."
6363+ },
6464+ "mentionRule": {
6565+ "type": "object",
6666+ "properties": {},
6767+ "description": "Allow replies from actors mentioned in your post."
6868+ },
6969+ "followerRule": {
7070+ "type": "object",
7171+ "properties": {},
7272+ "description": "Allow replies from actors who follow you."
7373+ },
7474+ "followingRule": {
7575+ "type": "object",
7676+ "properties": {},
7777+ "description": "Allow replies from actors you follow."
7878+ }
7979+ }
8080+}
···11+{
22+ "lexicon": 1,
33+ "id": "app.bsky.richtext.facet",
44+ "defs": {
55+ "tag": {
66+ "type": "object",
77+ "required": [
88+ "tag"
99+ ],
1010+ "properties": {
1111+ "tag": {
1212+ "type": "string",
1313+ "maxLength": 640,
1414+ "maxGraphemes": 64
1515+ }
1616+ },
1717+ "description": "Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags')."
1818+ },
1919+ "link": {
2020+ "type": "object",
2121+ "required": [
2222+ "uri"
2323+ ],
2424+ "properties": {
2525+ "uri": {
2626+ "type": "string",
2727+ "format": "uri"
2828+ }
2929+ },
3030+ "description": "Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL."
3131+ },
3232+ "main": {
3333+ "type": "object",
3434+ "required": [
3535+ "index",
3636+ "features"
3737+ ],
3838+ "properties": {
3939+ "index": {
4040+ "ref": "#byteSlice",
4141+ "type": "ref"
4242+ },
4343+ "features": {
4444+ "type": "array",
4545+ "items": {
4646+ "refs": [
4747+ "#mention",
4848+ "#link",
4949+ "#tag"
5050+ ],
5151+ "type": "union"
5252+ }
5353+ }
5454+ },
5555+ "description": "Annotation of a sub-string within rich text."
5656+ },
5757+ "mention": {
5858+ "type": "object",
5959+ "required": [
6060+ "did"
6161+ ],
6262+ "properties": {
6363+ "did": {
6464+ "type": "string",
6565+ "format": "did"
6666+ }
6767+ },
6868+ "description": "Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID."
6969+ },
7070+ "byteSlice": {
7171+ "type": "object",
7272+ "required": [
7373+ "byteStart",
7474+ "byteEnd"
7575+ ],
7676+ "properties": {
7777+ "byteEnd": {
7878+ "type": "integer",
7979+ "minimum": 0
8080+ },
8181+ "byteStart": {
8282+ "type": "integer",
8383+ "minimum": 0
8484+ }
8585+ },
8686+ "description": "Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets."
8787+ }
8888+ }
8989+}
+192
lexicons/com/atproto/label/defs.json
···11+{
22+ "lexicon": 1,
33+ "id": "com.atproto.label.defs",
44+ "defs": {
55+ "label": {
66+ "type": "object",
77+ "required": [
88+ "src",
99+ "uri",
1010+ "val",
1111+ "cts"
1212+ ],
1313+ "properties": {
1414+ "cid": {
1515+ "type": "string",
1616+ "format": "cid",
1717+ "description": "Optionally, CID specifying the specific version of 'uri' resource this label applies to."
1818+ },
1919+ "cts": {
2020+ "type": "string",
2121+ "format": "datetime",
2222+ "description": "Timestamp when this label was created."
2323+ },
2424+ "exp": {
2525+ "type": "string",
2626+ "format": "datetime",
2727+ "description": "Timestamp at which this label expires (no longer applies)."
2828+ },
2929+ "neg": {
3030+ "type": "boolean",
3131+ "description": "If true, this is a negation label, overwriting a previous label."
3232+ },
3333+ "sig": {
3434+ "type": "bytes",
3535+ "description": "Signature of dag-cbor encoded label."
3636+ },
3737+ "src": {
3838+ "type": "string",
3939+ "format": "did",
4040+ "description": "DID of the actor who created this label."
4141+ },
4242+ "uri": {
4343+ "type": "string",
4444+ "format": "uri",
4545+ "description": "AT URI of the record, repository (account), or other resource that this label applies to."
4646+ },
4747+ "val": {
4848+ "type": "string",
4949+ "maxLength": 128,
5050+ "description": "The short string name of the value or type of this label."
5151+ },
5252+ "ver": {
5353+ "type": "integer",
5454+ "description": "The AT Protocol version of the label object."
5555+ }
5656+ },
5757+ "description": "Metadata tag on an atproto resource (eg, repo or record)."
5858+ },
5959+ "selfLabel": {
6060+ "type": "object",
6161+ "required": [
6262+ "val"
6363+ ],
6464+ "properties": {
6565+ "val": {
6666+ "type": "string",
6767+ "maxLength": 128,
6868+ "description": "The short string name of the value or type of this label."
6969+ }
7070+ },
7171+ "description": "Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel."
7272+ },
7373+ "labelValue": {
7474+ "type": "string",
7575+ "knownValues": [
7676+ "!hide",
7777+ "!no-promote",
7878+ "!warn",
7979+ "!no-unauthenticated",
8080+ "dmca-violation",
8181+ "doxxing",
8282+ "porn",
8383+ "sexual",
8484+ "nudity",
8585+ "nsfl",
8686+ "gore"
8787+ ]
8888+ },
8989+ "selfLabels": {
9090+ "type": "object",
9191+ "required": [
9292+ "values"
9393+ ],
9494+ "properties": {
9595+ "values": {
9696+ "type": "array",
9797+ "items": {
9898+ "ref": "#selfLabel",
9999+ "type": "ref"
100100+ },
101101+ "maxLength": 10
102102+ }
103103+ },
104104+ "description": "Metadata tags on an atproto record, published by the author within the record."
105105+ },
106106+ "labelValueDefinition": {
107107+ "type": "object",
108108+ "required": [
109109+ "identifier",
110110+ "severity",
111111+ "blurs",
112112+ "locales"
113113+ ],
114114+ "properties": {
115115+ "blurs": {
116116+ "type": "string",
117117+ "description": "What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.",
118118+ "knownValues": [
119119+ "content",
120120+ "media",
121121+ "none"
122122+ ]
123123+ },
124124+ "locales": {
125125+ "type": "array",
126126+ "items": {
127127+ "ref": "#labelValueDefinitionStrings",
128128+ "type": "ref"
129129+ }
130130+ },
131131+ "severity": {
132132+ "type": "string",
133133+ "description": "How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.",
134134+ "knownValues": [
135135+ "inform",
136136+ "alert",
137137+ "none"
138138+ ]
139139+ },
140140+ "adultOnly": {
141141+ "type": "boolean",
142142+ "description": "Does the user need to have adult content enabled in order to configure this label?"
143143+ },
144144+ "identifier": {
145145+ "type": "string",
146146+ "maxLength": 100,
147147+ "description": "The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).",
148148+ "maxGraphemes": 100
149149+ },
150150+ "defaultSetting": {
151151+ "type": "string",
152152+ "default": "warn",
153153+ "description": "The default setting for this label.",
154154+ "knownValues": [
155155+ "ignore",
156156+ "warn",
157157+ "hide"
158158+ ]
159159+ }
160160+ },
161161+ "description": "Declares a label value and its expected interpretations and behaviors."
162162+ },
163163+ "labelValueDefinitionStrings": {
164164+ "type": "object",
165165+ "required": [
166166+ "lang",
167167+ "name",
168168+ "description"
169169+ ],
170170+ "properties": {
171171+ "lang": {
172172+ "type": "string",
173173+ "format": "language",
174174+ "description": "The code of the language these strings are written in."
175175+ },
176176+ "name": {
177177+ "type": "string",
178178+ "maxLength": 640,
179179+ "description": "A short human-readable name for the label.",
180180+ "maxGraphemes": 64
181181+ },
182182+ "description": {
183183+ "type": "string",
184184+ "maxLength": 100000,
185185+ "description": "A longer description of what the label means and why it might be applied.",
186186+ "maxGraphemes": 10000
187187+ }
188188+ },
189189+ "description": "Strings which describe the label in the UI, localized into a specific language."
190190+ }
191191+ }
192192+}
···11+{
22+ "lexicon": 1,
33+ "id": "social.grain.labeler.defs",
44+ "defs": {
55+ "labelerView": {
66+ "type": "object",
77+ "required": ["uri", "cid", "creator", "indexedAt"],
88+ "properties": {
99+ "uri": { "type": "string", "format": "at-uri" },
1010+ "cid": { "type": "string", "format": "cid" },
1111+ "creator": {
1212+ "type": "ref",
1313+ "ref": "social.grain.actor.defs#profileView"
1414+ },
1515+ "favoriteCount": { "type": "integer", "minimum": 0 },
1616+ "viewer": { "type": "ref", "ref": "#labelerViewerState" },
1717+ "indexedAt": { "type": "string", "format": "datetime" },
1818+ "labels": {
1919+ "type": "array",
2020+ "items": { "type": "ref", "ref": "com.atproto.label.defs#label" }
2121+ }
2222+ }
2323+ },
2424+ "labelerViewDetailed": {
2525+ "type": "object",
2626+ "required": ["uri", "cid", "creator", "policies", "indexedAt"],
2727+ "properties": {
2828+ "uri": { "type": "string", "format": "at-uri" },
2929+ "cid": { "type": "string", "format": "cid" },
3030+ "creator": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" },
3131+ "policies": {
3232+ "type": "ref",
3333+ "ref": "social.grain.actor.defs#labelerPolicies"
3434+ },
3535+ "favoriteCount": { "type": "integer", "minimum": 0 },
3636+ "viewer": { "type": "ref", "ref": "#labelerViewerState" },
3737+ "indexedAt": { "type": "string", "format": "datetime" },
3838+ "labels": {
3939+ "type": "array",
4040+ "items": { "type": "ref", "ref": "com.atproto.label.defs#label" }
4141+ },
4242+ "reasonTypes": {
4343+ "description": "The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed.",
4444+ "type": "array",
4545+ "items": {
4646+ "type": "ref",
4747+ "ref": "com.atproto.moderation.defs#reasonType"
4848+ }
4949+ },
5050+ "subjectTypes": {
5151+ "description": "The set of subject types (account, record, etc) this service accepts reports on.",
5252+ "type": "array",
5353+ "items": {
5454+ "type": "ref",
5555+ "ref": "com.atproto.moderation.defs#subjectType"
5656+ }
5757+ },
5858+ "subjectCollections": {
5959+ "type": "array",
6060+ "description": "Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type.",
6161+ "items": { "type": "string", "format": "nsid" }
6262+ }
6363+ }
6464+ },
6565+ "labelerViewerState": {
6666+ "type": "object",
6767+ "properties": {
6868+ "like": { "type": "string", "format": "at-uri" }
6969+ }
7070+ },
7171+ "labelerPolicies": {
7272+ "type": "object",
7373+ "required": ["labelValues"],
7474+ "properties": {
7575+ "labelValues": {
7676+ "type": "array",
7777+ "description": "The label values which this labeler publishes. May include global or custom labels.",
7878+ "items": {
7979+ "type": "ref",
8080+ "ref": "com.atproto.label.defs#labelValue"
8181+ }
8282+ },
8383+ "labelValueDefinitions": {
8484+ "type": "array",
8585+ "description": "Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler.",
8686+ "items": {
8787+ "type": "ref",
8888+ "ref": "com.atproto.label.defs#labelValueDefinition"
8989+ }
9090+ }
9191+ }
9292+ }
9393+ }
9494+}
+47
lexicons/social/grain/labelers/service.json
···11+{
22+ "lexicon": 1,
33+ "id": "social.grain.labeler.service",
44+ "defs": {
55+ "main": {
66+ "type": "record",
77+ "description": "A declaration of the existence of labeler service.",
88+ "key": "literal:self",
99+ "record": {
1010+ "type": "object",
1111+ "required": ["policies", "createdAt"],
1212+ "properties": {
1313+ "policies": {
1414+ "type": "ref",
1515+ "ref": "app.bsky.labeler.defs#labelerPolicies"
1616+ },
1717+ "labels": {
1818+ "type": "union",
1919+ "refs": ["com.atproto.label.defs#selfLabels"]
2020+ },
2121+ "createdAt": { "type": "string", "format": "datetime" },
2222+ "reasonTypes": {
2323+ "description": "The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed.",
2424+ "type": "array",
2525+ "items": {
2626+ "type": "ref",
2727+ "ref": "com.atproto.moderation.defs#reasonType"
2828+ }
2929+ },
3030+ "subjectTypes": {
3131+ "description": "The set of subject types (account, record, etc) this service accepts reports on.",
3232+ "type": "array",
3333+ "items": {
3434+ "type": "ref",
3535+ "ref": "com.atproto.moderation.defs#subjectType"
3636+ }
3737+ },
3838+ "subjectCollections": {
3939+ "type": "array",
4040+ "description": "Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type.",
4141+ "items": { "type": "string", "format": "nsid" }
4242+ }
4343+ }
4444+ }
4545+ }
4646+ }
4747+}
···11+// coverage:ignore-file
22+// GENERATED CODE - DO NOT MODIFY BY HAND
33+// ignore_for_file: type=lint
44+// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
55+66+part of 'apply_alts_response.dart';
77+88+// **************************************************************************
99+// FreezedGenerator
1010+// **************************************************************************
1111+1212+T _$identity<T>(T value) => value;
1313+1414+final _privateConstructorUsedError = UnsupportedError(
1515+ 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
1616+);
1717+1818+ApplyAltsResponse _$ApplyAltsResponseFromJson(Map<String, dynamic> json) {
1919+ return _ApplyAltsResponse.fromJson(json);
2020+}
2121+2222+/// @nodoc
2323+mixin _$ApplyAltsResponse {
2424+ bool get success => throw _privateConstructorUsedError;
2525+2626+ /// Serializes this ApplyAltsResponse to a JSON map.
2727+ Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
2828+2929+ /// Create a copy of ApplyAltsResponse
3030+ /// with the given fields replaced by the non-null parameter values.
3131+ @JsonKey(includeFromJson: false, includeToJson: false)
3232+ $ApplyAltsResponseCopyWith<ApplyAltsResponse> get copyWith =>
3333+ throw _privateConstructorUsedError;
3434+}
3535+3636+/// @nodoc
3737+abstract class $ApplyAltsResponseCopyWith<$Res> {
3838+ factory $ApplyAltsResponseCopyWith(
3939+ ApplyAltsResponse value,
4040+ $Res Function(ApplyAltsResponse) then,
4141+ ) = _$ApplyAltsResponseCopyWithImpl<$Res, ApplyAltsResponse>;
4242+ @useResult
4343+ $Res call({bool success});
4444+}
4545+4646+/// @nodoc
4747+class _$ApplyAltsResponseCopyWithImpl<$Res, $Val extends ApplyAltsResponse>
4848+ implements $ApplyAltsResponseCopyWith<$Res> {
4949+ _$ApplyAltsResponseCopyWithImpl(this._value, this._then);
5050+5151+ // ignore: unused_field
5252+ final $Val _value;
5353+ // ignore: unused_field
5454+ final $Res Function($Val) _then;
5555+5656+ /// Create a copy of ApplyAltsResponse
5757+ /// with the given fields replaced by the non-null parameter values.
5858+ @pragma('vm:prefer-inline')
5959+ @override
6060+ $Res call({Object? success = null}) {
6161+ return _then(
6262+ _value.copyWith(
6363+ success: null == success
6464+ ? _value.success
6565+ : success // ignore: cast_nullable_to_non_nullable
6666+ as bool,
6767+ )
6868+ as $Val,
6969+ );
7070+ }
7171+}
7272+7373+/// @nodoc
7474+abstract class _$$ApplyAltsResponseImplCopyWith<$Res>
7575+ implements $ApplyAltsResponseCopyWith<$Res> {
7676+ factory _$$ApplyAltsResponseImplCopyWith(
7777+ _$ApplyAltsResponseImpl value,
7878+ $Res Function(_$ApplyAltsResponseImpl) then,
7979+ ) = __$$ApplyAltsResponseImplCopyWithImpl<$Res>;
8080+ @override
8181+ @useResult
8282+ $Res call({bool success});
8383+}
8484+8585+/// @nodoc
8686+class __$$ApplyAltsResponseImplCopyWithImpl<$Res>
8787+ extends _$ApplyAltsResponseCopyWithImpl<$Res, _$ApplyAltsResponseImpl>
8888+ implements _$$ApplyAltsResponseImplCopyWith<$Res> {
8989+ __$$ApplyAltsResponseImplCopyWithImpl(
9090+ _$ApplyAltsResponseImpl _value,
9191+ $Res Function(_$ApplyAltsResponseImpl) _then,
9292+ ) : super(_value, _then);
9393+9494+ /// Create a copy of ApplyAltsResponse
9595+ /// with the given fields replaced by the non-null parameter values.
9696+ @pragma('vm:prefer-inline')
9797+ @override
9898+ $Res call({Object? success = null}) {
9999+ return _then(
100100+ _$ApplyAltsResponseImpl(
101101+ success: null == success
102102+ ? _value.success
103103+ : success // ignore: cast_nullable_to_non_nullable
104104+ as bool,
105105+ ),
106106+ );
107107+ }
108108+}
109109+110110+/// @nodoc
111111+@JsonSerializable()
112112+class _$ApplyAltsResponseImpl implements _ApplyAltsResponse {
113113+ const _$ApplyAltsResponseImpl({required this.success});
114114+115115+ factory _$ApplyAltsResponseImpl.fromJson(Map<String, dynamic> json) =>
116116+ _$$ApplyAltsResponseImplFromJson(json);
117117+118118+ @override
119119+ final bool success;
120120+121121+ @override
122122+ String toString() {
123123+ return 'ApplyAltsResponse(success: $success)';
124124+ }
125125+126126+ @override
127127+ bool operator ==(Object other) {
128128+ return identical(this, other) ||
129129+ (other.runtimeType == runtimeType &&
130130+ other is _$ApplyAltsResponseImpl &&
131131+ (identical(other.success, success) || other.success == success));
132132+ }
133133+134134+ @JsonKey(includeFromJson: false, includeToJson: false)
135135+ @override
136136+ int get hashCode => Object.hash(runtimeType, success);
137137+138138+ /// Create a copy of ApplyAltsResponse
139139+ /// with the given fields replaced by the non-null parameter values.
140140+ @JsonKey(includeFromJson: false, includeToJson: false)
141141+ @override
142142+ @pragma('vm:prefer-inline')
143143+ _$$ApplyAltsResponseImplCopyWith<_$ApplyAltsResponseImpl> get copyWith =>
144144+ __$$ApplyAltsResponseImplCopyWithImpl<_$ApplyAltsResponseImpl>(
145145+ this,
146146+ _$identity,
147147+ );
148148+149149+ @override
150150+ Map<String, dynamic> toJson() {
151151+ return _$$ApplyAltsResponseImplToJson(this);
152152+ }
153153+}
154154+155155+abstract class _ApplyAltsResponse implements ApplyAltsResponse {
156156+ const factory _ApplyAltsResponse({required final bool success}) =
157157+ _$ApplyAltsResponseImpl;
158158+159159+ factory _ApplyAltsResponse.fromJson(Map<String, dynamic> json) =
160160+ _$ApplyAltsResponseImpl.fromJson;
161161+162162+ @override
163163+ bool get success;
164164+165165+ /// Create a copy of ApplyAltsResponse
166166+ /// with the given fields replaced by the non-null parameter values.
167167+ @override
168168+ @JsonKey(includeFromJson: false, includeToJson: false)
169169+ _$$ApplyAltsResponseImplCopyWith<_$ApplyAltsResponseImpl> get copyWith =>
170170+ throw _privateConstructorUsedError;
171171+}
+15
lib/models/procedures/apply_alts_response.g.dart
···11+// GENERATED CODE - DO NOT MODIFY BY HAND
22+33+part of 'apply_alts_response.dart';
44+55+// **************************************************************************
66+// JsonSerializableGenerator
77+// **************************************************************************
88+99+_$ApplyAltsResponseImpl _$$ApplyAltsResponseImplFromJson(
1010+ Map<String, dynamic> json,
1111+) => _$ApplyAltsResponseImpl(success: json['success'] as bool);
1212+1313+Map<String, dynamic> _$$ApplyAltsResponseImplToJson(
1414+ _$ApplyAltsResponseImpl instance,
1515+) => <String, dynamic>{'success': instance.success};
+13
lib/models/procedures/apply_alts_update.dart
···11+import 'package:freezed_annotation/freezed_annotation.dart';
22+33+part 'apply_alts_update.freezed.dart';
44+part 'apply_alts_update.g.dart';
55+66+/// Update alt text for a photo in a gallery.
77+/// AT URI of the item to update and the alt text to apply.
88+@freezed
99+class ApplyAltsUpdate with _$ApplyAltsUpdate {
1010+ const factory ApplyAltsUpdate({required String photoUri, required String alt}) = _ApplyAltsUpdate;
1111+1212+ factory ApplyAltsUpdate.fromJson(Map<String, dynamic> json) => _$ApplyAltsUpdateFromJson(json);
1313+}
···11+// coverage:ignore-file
22+// GENERATED CODE - DO NOT MODIFY BY HAND
33+// ignore_for_file: type=lint
44+// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
55+66+part of 'create_exif_request.dart';
77+88+// **************************************************************************
99+// FreezedGenerator
1010+// **************************************************************************
1111+1212+T _$identity<T>(T value) => value;
1313+1414+final _privateConstructorUsedError = UnsupportedError(
1515+ 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
1616+);
1717+1818+CreateExifRequest _$CreateExifRequestFromJson(Map<String, dynamic> json) {
1919+ return _CreateExifRequest.fromJson(json);
2020+}
2121+2222+/// @nodoc
2323+mixin _$CreateExifRequest {
2424+ String get photo => throw _privateConstructorUsedError;
2525+ String? get dateTimeOriginal => throw _privateConstructorUsedError;
2626+ int? get exposureTime => throw _privateConstructorUsedError;
2727+ int? get fNumber => throw _privateConstructorUsedError;
2828+ String? get flash => throw _privateConstructorUsedError;
2929+ int? get focalLengthIn35mmFormat => throw _privateConstructorUsedError;
3030+ int? get iSO => throw _privateConstructorUsedError;
3131+ String? get lensMake => throw _privateConstructorUsedError;
3232+ String? get lensModel => throw _privateConstructorUsedError;
3333+ String? get make => throw _privateConstructorUsedError;
3434+ String? get model => throw _privateConstructorUsedError;
3535+3636+ /// Serializes this CreateExifRequest to a JSON map.
3737+ Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
3838+3939+ /// Create a copy of CreateExifRequest
4040+ /// with the given fields replaced by the non-null parameter values.
4141+ @JsonKey(includeFromJson: false, includeToJson: false)
4242+ $CreateExifRequestCopyWith<CreateExifRequest> get copyWith =>
4343+ throw _privateConstructorUsedError;
4444+}
4545+4646+/// @nodoc
4747+abstract class $CreateExifRequestCopyWith<$Res> {
4848+ factory $CreateExifRequestCopyWith(
4949+ CreateExifRequest value,
5050+ $Res Function(CreateExifRequest) then,
5151+ ) = _$CreateExifRequestCopyWithImpl<$Res, CreateExifRequest>;
5252+ @useResult
5353+ $Res call({
5454+ String photo,
5555+ String? dateTimeOriginal,
5656+ int? exposureTime,
5757+ int? fNumber,
5858+ String? flash,
5959+ int? focalLengthIn35mmFormat,
6060+ int? iSO,
6161+ String? lensMake,
6262+ String? lensModel,
6363+ String? make,
6464+ String? model,
6565+ });
6666+}
6767+6868+/// @nodoc
6969+class _$CreateExifRequestCopyWithImpl<$Res, $Val extends CreateExifRequest>
7070+ implements $CreateExifRequestCopyWith<$Res> {
7171+ _$CreateExifRequestCopyWithImpl(this._value, this._then);
7272+7373+ // ignore: unused_field
7474+ final $Val _value;
7575+ // ignore: unused_field
7676+ final $Res Function($Val) _then;
7777+7878+ /// Create a copy of CreateExifRequest
7979+ /// with the given fields replaced by the non-null parameter values.
8080+ @pragma('vm:prefer-inline')
8181+ @override
8282+ $Res call({
8383+ Object? photo = null,
8484+ Object? dateTimeOriginal = freezed,
8585+ Object? exposureTime = freezed,
8686+ Object? fNumber = freezed,
8787+ Object? flash = freezed,
8888+ Object? focalLengthIn35mmFormat = freezed,
8989+ Object? iSO = freezed,
9090+ Object? lensMake = freezed,
9191+ Object? lensModel = freezed,
9292+ Object? make = freezed,
9393+ Object? model = freezed,
9494+ }) {
9595+ return _then(
9696+ _value.copyWith(
9797+ photo: null == photo
9898+ ? _value.photo
9999+ : photo // ignore: cast_nullable_to_non_nullable
100100+ as String,
101101+ dateTimeOriginal: freezed == dateTimeOriginal
102102+ ? _value.dateTimeOriginal
103103+ : dateTimeOriginal // ignore: cast_nullable_to_non_nullable
104104+ as String?,
105105+ exposureTime: freezed == exposureTime
106106+ ? _value.exposureTime
107107+ : exposureTime // ignore: cast_nullable_to_non_nullable
108108+ as int?,
109109+ fNumber: freezed == fNumber
110110+ ? _value.fNumber
111111+ : fNumber // ignore: cast_nullable_to_non_nullable
112112+ as int?,
113113+ flash: freezed == flash
114114+ ? _value.flash
115115+ : flash // ignore: cast_nullable_to_non_nullable
116116+ as String?,
117117+ focalLengthIn35mmFormat: freezed == focalLengthIn35mmFormat
118118+ ? _value.focalLengthIn35mmFormat
119119+ : focalLengthIn35mmFormat // ignore: cast_nullable_to_non_nullable
120120+ as int?,
121121+ iSO: freezed == iSO
122122+ ? _value.iSO
123123+ : iSO // ignore: cast_nullable_to_non_nullable
124124+ as int?,
125125+ lensMake: freezed == lensMake
126126+ ? _value.lensMake
127127+ : lensMake // ignore: cast_nullable_to_non_nullable
128128+ as String?,
129129+ lensModel: freezed == lensModel
130130+ ? _value.lensModel
131131+ : lensModel // ignore: cast_nullable_to_non_nullable
132132+ as String?,
133133+ make: freezed == make
134134+ ? _value.make
135135+ : make // ignore: cast_nullable_to_non_nullable
136136+ as String?,
137137+ model: freezed == model
138138+ ? _value.model
139139+ : model // ignore: cast_nullable_to_non_nullable
140140+ as String?,
141141+ )
142142+ as $Val,
143143+ );
144144+ }
145145+}
146146+147147+/// @nodoc
148148+abstract class _$$CreateExifRequestImplCopyWith<$Res>
149149+ implements $CreateExifRequestCopyWith<$Res> {
150150+ factory _$$CreateExifRequestImplCopyWith(
151151+ _$CreateExifRequestImpl value,
152152+ $Res Function(_$CreateExifRequestImpl) then,
153153+ ) = __$$CreateExifRequestImplCopyWithImpl<$Res>;
154154+ @override
155155+ @useResult
156156+ $Res call({
157157+ String photo,
158158+ String? dateTimeOriginal,
159159+ int? exposureTime,
160160+ int? fNumber,
161161+ String? flash,
162162+ int? focalLengthIn35mmFormat,
163163+ int? iSO,
164164+ String? lensMake,
165165+ String? lensModel,
166166+ String? make,
167167+ String? model,
168168+ });
169169+}
170170+171171+/// @nodoc
172172+class __$$CreateExifRequestImplCopyWithImpl<$Res>
173173+ extends _$CreateExifRequestCopyWithImpl<$Res, _$CreateExifRequestImpl>
174174+ implements _$$CreateExifRequestImplCopyWith<$Res> {
175175+ __$$CreateExifRequestImplCopyWithImpl(
176176+ _$CreateExifRequestImpl _value,
177177+ $Res Function(_$CreateExifRequestImpl) _then,
178178+ ) : super(_value, _then);
179179+180180+ /// Create a copy of CreateExifRequest
181181+ /// with the given fields replaced by the non-null parameter values.
182182+ @pragma('vm:prefer-inline')
183183+ @override
184184+ $Res call({
185185+ Object? photo = null,
186186+ Object? dateTimeOriginal = freezed,
187187+ Object? exposureTime = freezed,
188188+ Object? fNumber = freezed,
189189+ Object? flash = freezed,
190190+ Object? focalLengthIn35mmFormat = freezed,
191191+ Object? iSO = freezed,
192192+ Object? lensMake = freezed,
193193+ Object? lensModel = freezed,
194194+ Object? make = freezed,
195195+ Object? model = freezed,
196196+ }) {
197197+ return _then(
198198+ _$CreateExifRequestImpl(
199199+ photo: null == photo
200200+ ? _value.photo
201201+ : photo // ignore: cast_nullable_to_non_nullable
202202+ as String,
203203+ dateTimeOriginal: freezed == dateTimeOriginal
204204+ ? _value.dateTimeOriginal
205205+ : dateTimeOriginal // ignore: cast_nullable_to_non_nullable
206206+ as String?,
207207+ exposureTime: freezed == exposureTime
208208+ ? _value.exposureTime
209209+ : exposureTime // ignore: cast_nullable_to_non_nullable
210210+ as int?,
211211+ fNumber: freezed == fNumber
212212+ ? _value.fNumber
213213+ : fNumber // ignore: cast_nullable_to_non_nullable
214214+ as int?,
215215+ flash: freezed == flash
216216+ ? _value.flash
217217+ : flash // ignore: cast_nullable_to_non_nullable
218218+ as String?,
219219+ focalLengthIn35mmFormat: freezed == focalLengthIn35mmFormat
220220+ ? _value.focalLengthIn35mmFormat
221221+ : focalLengthIn35mmFormat // ignore: cast_nullable_to_non_nullable
222222+ as int?,
223223+ iSO: freezed == iSO
224224+ ? _value.iSO
225225+ : iSO // ignore: cast_nullable_to_non_nullable
226226+ as int?,
227227+ lensMake: freezed == lensMake
228228+ ? _value.lensMake
229229+ : lensMake // ignore: cast_nullable_to_non_nullable
230230+ as String?,
231231+ lensModel: freezed == lensModel
232232+ ? _value.lensModel
233233+ : lensModel // ignore: cast_nullable_to_non_nullable
234234+ as String?,
235235+ make: freezed == make
236236+ ? _value.make
237237+ : make // ignore: cast_nullable_to_non_nullable
238238+ as String?,
239239+ model: freezed == model
240240+ ? _value.model
241241+ : model // ignore: cast_nullable_to_non_nullable
242242+ as String?,
243243+ ),
244244+ );
245245+ }
246246+}
247247+248248+/// @nodoc
249249+@JsonSerializable()
250250+class _$CreateExifRequestImpl implements _CreateExifRequest {
251251+ const _$CreateExifRequestImpl({
252252+ required this.photo,
253253+ this.dateTimeOriginal,
254254+ this.exposureTime,
255255+ this.fNumber,
256256+ this.flash,
257257+ this.focalLengthIn35mmFormat,
258258+ this.iSO,
259259+ this.lensMake,
260260+ this.lensModel,
261261+ this.make,
262262+ this.model,
263263+ });
264264+265265+ factory _$CreateExifRequestImpl.fromJson(Map<String, dynamic> json) =>
266266+ _$$CreateExifRequestImplFromJson(json);
267267+268268+ @override
269269+ final String photo;
270270+ @override
271271+ final String? dateTimeOriginal;
272272+ @override
273273+ final int? exposureTime;
274274+ @override
275275+ final int? fNumber;
276276+ @override
277277+ final String? flash;
278278+ @override
279279+ final int? focalLengthIn35mmFormat;
280280+ @override
281281+ final int? iSO;
282282+ @override
283283+ final String? lensMake;
284284+ @override
285285+ final String? lensModel;
286286+ @override
287287+ final String? make;
288288+ @override
289289+ final String? model;
290290+291291+ @override
292292+ String toString() {
293293+ return 'CreateExifRequest(photo: $photo, dateTimeOriginal: $dateTimeOriginal, exposureTime: $exposureTime, fNumber: $fNumber, flash: $flash, focalLengthIn35mmFormat: $focalLengthIn35mmFormat, iSO: $iSO, lensMake: $lensMake, lensModel: $lensModel, make: $make, model: $model)';
294294+ }
295295+296296+ @override
297297+ bool operator ==(Object other) {
298298+ return identical(this, other) ||
299299+ (other.runtimeType == runtimeType &&
300300+ other is _$CreateExifRequestImpl &&
301301+ (identical(other.photo, photo) || other.photo == photo) &&
302302+ (identical(other.dateTimeOriginal, dateTimeOriginal) ||
303303+ other.dateTimeOriginal == dateTimeOriginal) &&
304304+ (identical(other.exposureTime, exposureTime) ||
305305+ other.exposureTime == exposureTime) &&
306306+ (identical(other.fNumber, fNumber) || other.fNumber == fNumber) &&
307307+ (identical(other.flash, flash) || other.flash == flash) &&
308308+ (identical(
309309+ other.focalLengthIn35mmFormat,
310310+ focalLengthIn35mmFormat,
311311+ ) ||
312312+ other.focalLengthIn35mmFormat == focalLengthIn35mmFormat) &&
313313+ (identical(other.iSO, iSO) || other.iSO == iSO) &&
314314+ (identical(other.lensMake, lensMake) ||
315315+ other.lensMake == lensMake) &&
316316+ (identical(other.lensModel, lensModel) ||
317317+ other.lensModel == lensModel) &&
318318+ (identical(other.make, make) || other.make == make) &&
319319+ (identical(other.model, model) || other.model == model));
320320+ }
321321+322322+ @JsonKey(includeFromJson: false, includeToJson: false)
323323+ @override
324324+ int get hashCode => Object.hash(
325325+ runtimeType,
326326+ photo,
327327+ dateTimeOriginal,
328328+ exposureTime,
329329+ fNumber,
330330+ flash,
331331+ focalLengthIn35mmFormat,
332332+ iSO,
333333+ lensMake,
334334+ lensModel,
335335+ make,
336336+ model,
337337+ );
338338+339339+ /// Create a copy of CreateExifRequest
340340+ /// with the given fields replaced by the non-null parameter values.
341341+ @JsonKey(includeFromJson: false, includeToJson: false)
342342+ @override
343343+ @pragma('vm:prefer-inline')
344344+ _$$CreateExifRequestImplCopyWith<_$CreateExifRequestImpl> get copyWith =>
345345+ __$$CreateExifRequestImplCopyWithImpl<_$CreateExifRequestImpl>(
346346+ this,
347347+ _$identity,
348348+ );
349349+350350+ @override
351351+ Map<String, dynamic> toJson() {
352352+ return _$$CreateExifRequestImplToJson(this);
353353+ }
354354+}
355355+356356+abstract class _CreateExifRequest implements CreateExifRequest {
357357+ const factory _CreateExifRequest({
358358+ required final String photo,
359359+ final String? dateTimeOriginal,
360360+ final int? exposureTime,
361361+ final int? fNumber,
362362+ final String? flash,
363363+ final int? focalLengthIn35mmFormat,
364364+ final int? iSO,
365365+ final String? lensMake,
366366+ final String? lensModel,
367367+ final String? make,
368368+ final String? model,
369369+ }) = _$CreateExifRequestImpl;
370370+371371+ factory _CreateExifRequest.fromJson(Map<String, dynamic> json) =
372372+ _$CreateExifRequestImpl.fromJson;
373373+374374+ @override
375375+ String get photo;
376376+ @override
377377+ String? get dateTimeOriginal;
378378+ @override
379379+ int? get exposureTime;
380380+ @override
381381+ int? get fNumber;
382382+ @override
383383+ String? get flash;
384384+ @override
385385+ int? get focalLengthIn35mmFormat;
386386+ @override
387387+ int? get iSO;
388388+ @override
389389+ String? get lensMake;
390390+ @override
391391+ String? get lensModel;
392392+ @override
393393+ String? get make;
394394+ @override
395395+ String? get model;
396396+397397+ /// Create a copy of CreateExifRequest
398398+ /// with the given fields replaced by the non-null parameter values.
399399+ @override
400400+ @JsonKey(includeFromJson: false, includeToJson: false)
401401+ _$$CreateExifRequestImplCopyWith<_$CreateExifRequestImpl> get copyWith =>
402402+ throw _privateConstructorUsedError;
403403+}
+39
lib/models/procedures/create_exif_request.g.dart
···11+// GENERATED CODE - DO NOT MODIFY BY HAND
22+33+part of 'create_exif_request.dart';
44+55+// **************************************************************************
66+// JsonSerializableGenerator
77+// **************************************************************************
88+99+_$CreateExifRequestImpl _$$CreateExifRequestImplFromJson(
1010+ Map<String, dynamic> json,
1111+) => _$CreateExifRequestImpl(
1212+ photo: json['photo'] as String,
1313+ dateTimeOriginal: json['dateTimeOriginal'] as String?,
1414+ exposureTime: (json['exposureTime'] as num?)?.toInt(),
1515+ fNumber: (json['fNumber'] as num?)?.toInt(),
1616+ flash: json['flash'] as String?,
1717+ focalLengthIn35mmFormat: (json['focalLengthIn35mmFormat'] as num?)?.toInt(),
1818+ iSO: (json['iSO'] as num?)?.toInt(),
1919+ lensMake: json['lensMake'] as String?,
2020+ lensModel: json['lensModel'] as String?,
2121+ make: json['make'] as String?,
2222+ model: json['model'] as String?,
2323+);
2424+2525+Map<String, dynamic> _$$CreateExifRequestImplToJson(
2626+ _$CreateExifRequestImpl instance,
2727+) => <String, dynamic>{
2828+ 'photo': instance.photo,
2929+ 'dateTimeOriginal': instance.dateTimeOriginal,
3030+ 'exposureTime': instance.exposureTime,
3131+ 'fNumber': instance.fNumber,
3232+ 'flash': instance.flash,
3333+ 'focalLengthIn35mmFormat': instance.focalLengthIn35mmFormat,
3434+ 'iSO': instance.iSO,
3535+ 'lensMake': instance.lensMake,
3636+ 'lensModel': instance.lensModel,
3737+ 'make': instance.make,
3838+ 'model': instance.model,
3939+};
+15
lib/models/procedures/create_exif_response.dart
···11+import 'package:freezed_annotation/freezed_annotation.dart';
22+33+part 'create_exif_response.freezed.dart';
44+part 'create_exif_response.g.dart';
55+66+/// Response model for creating a new Exif record for a photo.
77+///
88+/// [exifUri] - The URI of the created Exif record.
99+@freezed
1010+class CreateExifResponse with _$CreateExifResponse {
1111+ const factory CreateExifResponse({required String exifUri}) = _CreateExifResponse;
1212+1313+ factory CreateExifResponse.fromJson(Map<String, dynamic> json) =>
1414+ _$CreateExifResponseFromJson(json);
1515+}
···11name: grain
22-description: "A new Flutter project."
22+description: "Grain Social Mobile App"
33# The following line prevents the package from being accidentally published to
44# pub.dev using `flutter pub publish`. This is preferred for private packages.
55publish_to: "none" # Remove this line if you wish to publish to pub.dev
···1616# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
1717# In Windows, build-name is used as the major, minor, and patch parts
1818# of the product and file versions while build-number is used as the build suffix.
1919-version: 1.0.0+17
1919+version: 1.0.0+20
20202121environment:
2222 sdk: ^3.8.1