1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
// This file is @generated by prost-build.
/// The primary data source for local and online products.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PrimaryProductDataSource {
    /// Required. Immutable. Specifies the type of data source channel.
    #[prost(enumeration = "primary_product_data_source::Channel", tag = "3")]
    pub channel: i32,
    /// Optional. Immutable. The feed label that is specified on the data source
    /// level.
    ///
    /// Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
    /// and dashes (-).
    ///
    /// See also [migration to feed
    /// labels](<https://developers.google.com/shopping-content/guides/products/feed-labels>).
    ///
    /// `feedLabel` and `contentLanguage` must be either both set or unset for data
    /// sources with product content type.
    /// They must be set for data sources with a file input.
    ///
    /// If set, the data source will only accept products matching this
    /// combination. If unset, the data source will accept products without that
    /// restriction.
    #[prost(string, optional, tag = "4")]
    pub feed_label: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional. Immutable. The two-letter ISO 639-1 language of the items in the
    /// data source.
    ///
    /// `feedLabel` and `contentLanguage` must be either both set or unset.
    /// The fields can only be unset for data sources without file input.
    ///
    /// If set, the data source will only accept products matching this
    /// combination. If unset, the data source will accept products without that
    /// restriction.
    #[prost(string, optional, tag = "5")]
    pub content_language: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional. The countries where the items may be displayed. Represented as a
    /// [CLDR territory
    /// code](<https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml>).
    #[prost(string, repeated, tag = "6")]
    pub countries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Nested message and enum types in `PrimaryProductDataSource`.
pub mod primary_product_data_source {
    /// Data Source Channel.
    ///
    /// Channel is used to distinguish between data sources for different product
    /// verticals.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Channel {
        /// Not specified.
        Unspecified = 0,
        /// Online product.
        OnlineProducts = 1,
        /// Local product.
        LocalProducts = 2,
        /// Unified data source for both local and online products.
        Products = 3,
    }
    impl Channel {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Channel::Unspecified => "CHANNEL_UNSPECIFIED",
                Channel::OnlineProducts => "ONLINE_PRODUCTS",
                Channel::LocalProducts => "LOCAL_PRODUCTS",
                Channel::Products => "PRODUCTS",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "CHANNEL_UNSPECIFIED" => Some(Self::Unspecified),
                "ONLINE_PRODUCTS" => Some(Self::OnlineProducts),
                "LOCAL_PRODUCTS" => Some(Self::LocalProducts),
                "PRODUCTS" => Some(Self::Products),
                _ => None,
            }
        }
    }
}
/// The supplemental data source for local and online products.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SupplementalProductDataSource {
    /// Optional. Immutable. The feed label that is specified on the data source
    /// level.
    ///
    /// Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
    /// and dashes (-).
    ///
    /// See also [migration to feed
    /// labels](<https://developers.google.com/shopping-content/guides/products/feed-labels>).
    ///
    /// `feedLabel` and `contentLanguage` must be either both set or unset for data
    /// sources with product content type.
    /// They must be set for data sources with a file input.
    ///
    /// If set, the data source will only accept products matching this
    /// combination. If unset, the data source will accept produts without that
    /// restriction.
    #[prost(string, optional, tag = "4")]
    pub feed_label: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional. Immutable. The two-letter ISO 639-1 language of the items in the
    /// data source.
    ///
    /// `feedLabel` and `contentLanguage` must be either both set or unset.
    /// The fields can only be unset for data sources without file input.
    ///
    /// If set, the data source will only accept products matching this
    /// combination. If unset, the data source will accept produts without that
    /// restriction.
    #[prost(string, optional, tag = "5")]
    pub content_language: ::core::option::Option<::prost::alloc::string::String>,
}
/// The local inventory data source.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LocalInventoryDataSource {
    /// Required. Immutable. The feed label of the offers to which the local
    /// inventory is provided.
    ///
    /// Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
    /// and dashes (-).
    ///
    /// See also [migration to feed
    /// labels](<https://developers.google.com/shopping-content/guides/products/feed-labels>).
    #[prost(string, tag = "4")]
    pub feed_label: ::prost::alloc::string::String,
    /// Required. Immutable. The two-letter ISO 639-1 language of the items to
    /// which the local inventory is provided.
    #[prost(string, tag = "5")]
    pub content_language: ::prost::alloc::string::String,
}
/// The regional inventory data source.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RegionalInventoryDataSource {
    /// Required. Immutable. The feed label of the offers to which the regional
    /// inventory is provided.
    ///
    /// Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
    /// and dashes (-).
    ///
    /// See also [migration to feed
    /// labels](<https://developers.google.com/shopping-content/guides/products/feed-labels>).
    #[prost(string, tag = "4")]
    pub feed_label: ::prost::alloc::string::String,
    /// Required. Immutable. The two-letter ISO 639-1 language of the items to
    /// which the regional inventory is provided.
    #[prost(string, tag = "5")]
    pub content_language: ::prost::alloc::string::String,
}
/// The promotion data source.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PromotionDataSource {
    /// Required. Immutable. The target country used as part of the unique
    /// identifier. Represented as a [CLDR territory
    /// code](<https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml>).
    ///
    /// Promotions are only available in selected
    /// [countries](<https://support.google.com/merchants/answer/4588460>).
    #[prost(string, tag = "1")]
    pub target_country: ::prost::alloc::string::String,
    /// Required. Immutable. The two-letter ISO 639-1 language of the items in the
    /// data source.
    #[prost(string, tag = "2")]
    pub content_language: ::prost::alloc::string::String,
}
/// The data specific for file data sources. This field is empty for other
/// data source inputs.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileInput {
    /// Optional. Fetch details to deliver the data source. It contains settings
    /// for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
    /// based on the frequency of fetching.
    #[prost(message, optional, tag = "1")]
    pub fetch_settings: ::core::option::Option<file_input::FetchSettings>,
    /// Optional. The file name of the data source. Required for `UPLOAD` file
    /// input type.
    #[prost(string, tag = "2")]
    pub file_name: ::prost::alloc::string::String,
    /// Output only. The type of file input.
    #[prost(enumeration = "file_input::FileInputType", tag = "3")]
    pub file_input_type: i32,
}
/// Nested message and enum types in `FileInput`.
pub mod file_input {
    /// Fetch details to deliver the data source.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct FetchSettings {
        /// Optional. Enables or pauses the fetch schedule.
        #[prost(bool, tag = "1")]
        pub enabled: bool,
        /// Optional. The day of the month when the data source file should be
        /// fetched (1-31). This field can only be set for monthly frequency.
        #[prost(int32, tag = "2")]
        pub day_of_month: i32,
        /// Optional. The hour of the day when the data source file should be
        /// fetched. Minutes and seconds are not supported and will be ignored.
        #[prost(message, optional, tag = "3")]
        pub time_of_day: ::core::option::Option<
            super::super::super::super::super::r#type::TimeOfDay,
        >,
        /// Optional. The day of the week when the data source file should be
        /// fetched. This field can only be set for weekly frequency.
        #[prost(
            enumeration = "super::super::super::super::super::r#type::DayOfWeek",
            tag = "4"
        )]
        pub day_of_week: i32,
        /// Optional. [Time zone](<https://cldr.unicode.org>) used for schedule. UTC by
        /// default. For example, "America/Los_Angeles".
        #[prost(string, tag = "5")]
        pub time_zone: ::prost::alloc::string::String,
        /// Required. The frequency describing fetch schedule.
        #[prost(enumeration = "fetch_settings::Frequency", tag = "6")]
        pub frequency: i32,
        /// Optional. The URL where the data source file can be fetched. Google
        /// Merchant Center supports automatic scheduled uploads using the HTTP,
        /// HTTPS or SFTP protocols, so the value will need to be a valid link using
        /// one of those three protocols. Immutable for Google Sheets files.
        #[prost(string, tag = "7")]
        pub fetch_uri: ::prost::alloc::string::String,
        /// Optional. An optional user name for [fetch
        /// url][google.shopping.content.bundles.DataSources.FileInput.fetch_url].
        /// Used for [submitting data sources through
        /// SFTP](<https://support.google.com/merchants/answer/13813117>).
        #[prost(string, tag = "8")]
        pub username: ::prost::alloc::string::String,
        /// Optional. An optional password for [fetch
        /// url][google.shopping.content.bundles.DataSources.FileInput.fetch_url].
        /// Used for [submitting data sources through
        /// SFTP](<https://support.google.com/merchants/answer/13813117>).
        #[prost(string, tag = "9")]
        pub password: ::prost::alloc::string::String,
    }
    /// Nested message and enum types in `FetchSettings`.
    pub mod fetch_settings {
        /// The required fields vary based on the frequency of fetching. For a
        /// monthly
        /// fetch schedule,
        /// [day of
        /// month][google.shopping.content.bundles.DataSources.FileInput.FetchSchedule.day_of_month]
        /// and
        /// [hour of
        /// day][google.shopping.content.bundles.DataSources.FileInput.FetchSchedule.time_of_day]
        /// are required. For a weekly fetch schedule,
        /// [day of
        /// week][google.shopping.content.bundles.DataSources.FileInput.FetchSchedule.day_of_week]
        /// and [hour of
        /// day][google.shopping.content.bundles.DataSources.FileInput.FetchSchedule.time_of_day]
        /// are required. For a daily fetch schedule, only an [hour of
        /// day][google.shopping.content.bundles.DataSources.FileInput.FetchSchedule.time_of_day]
        /// is required.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum Frequency {
            /// Frequency unspecified.
            Unspecified = 0,
            /// The fetch happens every day.
            Daily = 1,
            /// The fetch happens every week.
            Weekly = 2,
            /// The fetch happens every month.
            Monthly = 3,
        }
        impl Frequency {
            /// String value of the enum field names used in the ProtoBuf definition.
            ///
            /// The values are not transformed in any way and thus are considered stable
            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
            pub fn as_str_name(&self) -> &'static str {
                match self {
                    Frequency::Unspecified => "FREQUENCY_UNSPECIFIED",
                    Frequency::Daily => "FREQUENCY_DAILY",
                    Frequency::Weekly => "FREQUENCY_WEEKLY",
                    Frequency::Monthly => "FREQUENCY_MONTHLY",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "FREQUENCY_UNSPECIFIED" => Some(Self::Unspecified),
                    "FREQUENCY_DAILY" => Some(Self::Daily),
                    "FREQUENCY_WEEKLY" => Some(Self::Weekly),
                    "FREQUENCY_MONTHLY" => Some(Self::Monthly),
                    _ => None,
                }
            }
        }
    }
    /// The method of file delivery.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum FileInputType {
        /// File input type unspecified.
        Unspecified = 0,
        /// The file is uploaded through SFTP, Google Cloud Storage or manually in
        /// the Merchant Center.
        Upload = 1,
        /// The file is fetched from the configured
        /// [fetch_uri][google.shopping.content.bundles.DataSources.FileInput.FetchSettings.fetch_uri].
        Fetch = 2,
        /// The file is fetched from Google Sheets specified in the
        /// [fetch_uri][google.shopping.content.bundles.DataSources.FileInput.FetchSettings.fetch_uri].
        GoogleSheets = 3,
    }
    impl FileInputType {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                FileInputType::Unspecified => "FILE_INPUT_TYPE_UNSPECIFIED",
                FileInputType::Upload => "UPLOAD",
                FileInputType::Fetch => "FETCH",
                FileInputType::GoogleSheets => "GOOGLE_SHEETS",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "FILE_INPUT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "UPLOAD" => Some(Self::Upload),
                "FETCH" => Some(Self::Fetch),
                "GOOGLE_SHEETS" => Some(Self::GoogleSheets),
                _ => None,
            }
        }
    }
}
/// The [data source](<https://support.google.com/merchants/answer/7439058>) for
/// the Merchant Center account.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DataSource {
    /// Identifier. The name of the data source.
    /// Format:
    /// `{datasource.name=accounts/{account}/dataSources/{datasource}}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Output only. The data source id.
    #[prost(int64, tag = "2")]
    pub data_source_id: i64,
    /// Required. The displayed data source name in the Merchant Center UI.
    #[prost(string, tag = "3")]
    pub display_name: ::prost::alloc::string::String,
    /// Output only. Determines the type of input to the data source. Based on the
    /// input some settings might not work. Only generic data sources can be
    /// created through the API.
    #[prost(enumeration = "data_source::Input", tag = "10")]
    pub input: i32,
    /// Optional. The field is used only when data is managed through a file.
    #[prost(message, optional, tag = "11")]
    pub file_input: ::core::option::Option<FileInput>,
    /// The data source type.
    #[prost(oneof = "data_source::Type", tags = "4, 5, 6, 7, 8")]
    pub r#type: ::core::option::Option<data_source::Type>,
}
/// Nested message and enum types in `DataSource`.
pub mod data_source {
    /// Determines the type of input to the data source. Based on the input some
    /// settings might not be supported.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Input {
        /// Input unspecified.
        Unspecified = 0,
        /// Represents data sources for which the data is primarily provided through
        /// the API.
        Api = 1,
        /// Represents data sources for which the data is primarily provided through
        /// file input. Data can still be provided through the API.
        File = 2,
        /// The data source for products added directly in Merchant Center.
        ///
        /// This type of data source can not be created or updated through this API,
        /// only by Merchant Center UI.
        ///
        /// This type of data source is read only.
        Ui = 3,
        /// This is also known as
        /// [Automated feeds](<https://support.google.com/merchants/answer/12158480>)
        /// used to automatically build your product data. This type of data source
        /// can be enabled or disabled through the Accounts bundle.
        Autofeed = 4,
    }
    impl Input {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Input::Unspecified => "INPUT_UNSPECIFIED",
                Input::Api => "API",
                Input::File => "FILE",
                Input::Ui => "UI",
                Input::Autofeed => "AUTOFEED",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "INPUT_UNSPECIFIED" => Some(Self::Unspecified),
                "API" => Some(Self::Api),
                "FILE" => Some(Self::File),
                "UI" => Some(Self::Ui),
                "AUTOFEED" => Some(Self::Autofeed),
                _ => None,
            }
        }
    }
    /// The data source type.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Type {
        /// Required. The [primary data
        /// source](<https://support.google.com/merchants/answer/7439058>) for local
        /// and online products.
        #[prost(message, tag = "4")]
        PrimaryProductDataSource(super::PrimaryProductDataSource),
        /// Required. The [supplemental data
        /// source](<https://support.google.com/merchants/answer/7439058>) for local
        /// and online products.
        #[prost(message, tag = "5")]
        SupplementalProductDataSource(super::SupplementalProductDataSource),
        /// Required. The [local
        /// inventory](<https://support.google.com/merchants/answer/7023001>) data
        /// source.
        #[prost(message, tag = "6")]
        LocalInventoryDataSource(super::LocalInventoryDataSource),
        /// Required. The [regional
        /// inventory](<https://support.google.com/merchants/answer/7439058>) data
        /// source.
        #[prost(message, tag = "7")]
        RegionalInventoryDataSource(super::RegionalInventoryDataSource),
        /// Required. The
        /// [promotion](<https://support.google.com/merchants/answer/2906014>) data
        /// source.
        #[prost(message, tag = "8")]
        PromotionDataSource(super::PromotionDataSource),
    }
}
/// Request message for the GetDataSource method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDataSourceRequest {
    /// Required. The name of the data source to retrieve.
    /// Format: `accounts/{account}/dataSources/{datasource}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request message for the ListDataSources method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListDataSourcesRequest {
    /// Required. The account to list data sources for.
    /// Format: `accounts/{account}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Optional. The maximum number of data sources to return. The service may
    /// return fewer than this value. The maximum value is 1000; values above 1000
    /// will be coerced to 1000. If unspecified, the maximum number of data sources
    /// will be returned.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// Optional. A page token, received from a previous `ListDataSources` call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided to `ListDataSources`
    /// must match the call that provided the page token.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
}
/// Response message for the ListDataSources method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListDataSourcesResponse {
    /// The data sources from the specified account.
    #[prost(message, repeated, tag = "1")]
    pub data_sources: ::prost::alloc::vec::Vec<DataSource>,
    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Request message for the CreateDataSource method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateDataSourceRequest {
    /// Required. The account where this data source will be created.
    /// Format: `accounts/{account}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The data source to create.
    #[prost(message, optional, tag = "2")]
    pub data_source: ::core::option::Option<DataSource>,
}
/// Request message for the UpdateDataSource method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateDataSourceRequest {
    /// Required. The data source resource to update.
    #[prost(message, optional, tag = "1")]
    pub data_source: ::core::option::Option<DataSource>,
    /// Required. The list of data source fields to be updated.
    ///
    /// Fields specified in the update mask without a value specified in the
    /// body will be deleted from the data source.
    ///
    /// Providing special "*" value for full data source replacement is not
    /// supported.
    #[prost(message, optional, tag = "2")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// Request message for the FetchDataSource method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FetchDataSourceRequest {
    /// Required. The name of the data source resource to fetch.
    /// Format: `accounts/{account}/dataSources/{datasource}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request message for the DeleteDataSource method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteDataSourceRequest {
    /// Required. The name of the data source to delete.
    /// Format: `accounts/{account}/dataSources/{datasource}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod data_sources_service_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Service to manage primary, supplemental, inventory and other data sources.
    /// See more in the [Merchant
    /// Center](https://support.google.com/merchants/answer/7439058) help article.
    #[derive(Debug, Clone)]
    pub struct DataSourcesServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl<T> DataSourcesServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> DataSourcesServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            DataSourcesServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Retrieves the data source configuration for the given account.
        pub async fn get_data_source(
            &mut self,
            request: impl tonic::IntoRequest<super::GetDataSourceRequest>,
        ) -> std::result::Result<tonic::Response<super::DataSource>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.shopping.merchant.datasources.v1beta.DataSourcesService/GetDataSource",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.shopping.merchant.datasources.v1beta.DataSourcesService",
                        "GetDataSource",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lists the configurations for data sources for the given account.
        pub async fn list_data_sources(
            &mut self,
            request: impl tonic::IntoRequest<super::ListDataSourcesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListDataSourcesResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.shopping.merchant.datasources.v1beta.DataSourcesService/ListDataSources",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.shopping.merchant.datasources.v1beta.DataSourcesService",
                        "ListDataSources",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Creates the new data source configuration for the given account.
        pub async fn create_data_source(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateDataSourceRequest>,
        ) -> std::result::Result<tonic::Response<super::DataSource>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.shopping.merchant.datasources.v1beta.DataSourcesService/CreateDataSource",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.shopping.merchant.datasources.v1beta.DataSourcesService",
                        "CreateDataSource",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Updates the existing data source configuration. The fields that are
        /// set in the update mask but not provided in the resource will be deleted.
        pub async fn update_data_source(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateDataSourceRequest>,
        ) -> std::result::Result<tonic::Response<super::DataSource>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.shopping.merchant.datasources.v1beta.DataSourcesService/UpdateDataSource",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.shopping.merchant.datasources.v1beta.DataSourcesService",
                        "UpdateDataSource",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a data source from your Merchant Center account.
        pub async fn delete_data_source(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteDataSourceRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.shopping.merchant.datasources.v1beta.DataSourcesService/DeleteDataSource",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.shopping.merchant.datasources.v1beta.DataSourcesService",
                        "DeleteDataSource",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Performs the data fetch immediately (even outside fetch schedule) on a
        /// data source from your Merchant Center Account. If you need to call
        /// this method more than once per day, you should use the Products service to
        /// update your product data instead.
        /// This method only works on data sources with a file input set.
        pub async fn fetch_data_source(
            &mut self,
            request: impl tonic::IntoRequest<super::FetchDataSourceRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.shopping.merchant.datasources.v1beta.DataSourcesService/FetchDataSource",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.shopping.merchant.datasources.v1beta.DataSourcesService",
                        "FetchDataSource",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}