xref: /aosp_15_r20/external/googleapis/google/firestore/admin/v1/schedule.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.firestore.admin.v1;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/protobuf/duration.proto";
22import "google/protobuf/timestamp.proto";
23import "google/type/dayofweek.proto";
24
25option csharp_namespace = "Google.Cloud.Firestore.Admin.V1";
26option go_package = "cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb";
27option java_multiple_files = true;
28option java_outer_classname = "ScheduleProto";
29option java_package = "com.google.firestore.admin.v1";
30option objc_class_prefix = "GCFS";
31option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1";
32option ruby_package = "Google::Cloud::Firestore::Admin::V1";
33
34// A backup schedule for a Cloud Firestore Database.
35//
36// This resource is owned by the database it is backing up, and is deleted along
37// with the database. The actual backups are not though.
38message BackupSchedule {
39  option (google.api.resource) = {
40    type: "firestore.googleapis.com/BackupSchedule"
41    pattern: "projects/{project}/databases/{database}/backupSchedules/{backup_schedule}"
42  };
43
44  // Output only. The unique backup schedule identifier across all locations and
45  // databases for the given project.
46  //
47  // This will be auto-assigned.
48  //
49  // Format is
50  // `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
51  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
52
53  // Output only. The timestamp at which this backup schedule was created and
54  // effective since.
55  //
56  // No backups will be created for this schedule before this time.
57  google.protobuf.Timestamp create_time = 3
58      [(google.api.field_behavior) = OUTPUT_ONLY];
59
60  // Output only. The timestamp at which this backup schedule was most recently
61  // updated. When a backup schedule is first created, this is the same as
62  // create_time.
63  google.protobuf.Timestamp update_time = 10
64      [(google.api.field_behavior) = OUTPUT_ONLY];
65
66  // At what relative time in the future, compared to its creation time,
67  // the backup should be deleted, e.g. keep backups for 7 days.
68  google.protobuf.Duration retention = 6;
69
70  // A oneof field to represent when backups will be taken.
71  oneof recurrence {
72    // For a schedule that runs daily.
73    DailyRecurrence daily_recurrence = 7;
74
75    // For a schedule that runs weekly on a specific day.
76    WeeklyRecurrence weekly_recurrence = 8;
77  }
78}
79
80// Represents a recurring schedule that runs at a specific time every day.
81//
82// The time zone is UTC.
83message DailyRecurrence {}
84
85// Represents a recurring schedule that runs on a specified day of the week.
86//
87// The time zone is UTC.
88message WeeklyRecurrence {
89  // The day of week to run.
90  //
91  // DAY_OF_WEEK_UNSPECIFIED is not allowed.
92  google.type.DayOfWeek day = 2;
93}
94