librespot/protocol/proto/playlist_permission.proto
2024-12-16 22:57:12 +01:00

179 lines
4.6 KiB
Protocol Buffer

// Extracted from: Spotify 1.2.52.442 (windows)
syntax = "proto2";
package spotify.playlist_permission.proto;
option java_multiple_files = true;
option optimize_for = CODE_SIZE;
option java_package = "com.spotify.playlist.proto";
message Permission {
optional bytes revision = 1;
optional PermissionLevel permission_level = 2;
}
message GrantableLevels {
repeated PermissionLevel base = 1;
repeated PermissionLevel member = 2;
}
message AttributeCapabilities {
optional bool can_edit = 1;
}
message ListAttributeCapabilities {
optional AttributeCapabilities name = 1;
optional AttributeCapabilities description = 2;
optional AttributeCapabilities picture = 3;
optional AttributeCapabilities collaborative = 4;
optional AttributeCapabilities deleted_by_owner = 6;
optional AttributeCapabilities ai_curation_reference_id = 15;
}
message Capabilities {
optional bool can_view = 1;
optional bool can_administrate_permissions = 2;
repeated PermissionLevel grantable_level = 3;
optional bool can_edit_metadata = 4;
optional bool can_edit_items = 5;
optional bool can_cancel_membership = 6;
optional GrantableLevels grantable_levels = 7;
optional ListAttributeCapabilities list_attribute_capabilities = 8;
}
message CapabilitiesMultiRequest {
repeated CapabilitiesRequest request = 1;
optional string fallback_username = 2;
optional string fallback_user_id = 3;
optional string fallback_uri = 4;
}
message CapabilitiesRequestOptions {
optional bool can_view_only = 1;
}
message CapabilitiesRequest {
optional string username = 1;
optional string user_id = 2;
optional string uri = 3;
optional bool user_is_owner = 4;
optional string permission_grant_token = 5;
optional CapabilitiesRequestOptions request_options = 6;
}
message CapabilitiesMultiResponse {
repeated CapabilitiesResponse response = 1;
}
message CapabilitiesResponse {
optional ResponseStatus status = 1;
optional Capabilities capabilities = 2;
}
message SetPermissionLevelRequest {
optional PermissionLevel permission_level = 1;
}
message SetPermissionResponse {
optional Permission resulting_permission = 1;
}
message GetMemberPermissionsResponse {
map<string, Permission> member_permissions = 1;
}
message Permissions {
optional Permission base_permission = 1;
}
message PermissionState {
optional Permissions permissions = 1;
optional Capabilities capabilities = 2;
optional bool is_private = 3;
optional bool is_collaborative = 4;
}
message PermissionStatePub {
optional PermissionState permission_state = 1;
}
message PermissionGrantOptions {
optional Permission permission = 1;
optional int64 ttl_ms = 2;
}
message PermissionGrant {
optional string token = 1;
optional PermissionGrantOptions permission_grant_options = 2;
}
message PermissionGrantDetails {
optional bool permission_level_downgraded = 1;
}
message PermissionGrantDescription {
enum ClaimFailReason {
CLAIM_FAIL_REASON_UNSPECIFIED = 0;
CLAIM_FAIL_REASON_ANONYMOUS = 1;
CLAIM_FAIL_REASON_NO_GRANT_FOUND = 2;
CLAIM_FAIL_REASON_GRANT_EXPIRED = 3;
}
optional PermissionGrantOptions permission_grant_options = 1;
optional ClaimFailReason claim_fail_reason = 2;
optional bool is_effective = 3;
optional Capabilities capabilities = 4;
repeated PermissionGrantDetails details = 5;
}
message ClaimPermissionGrantResponse {
optional Permission user_permission = 1;
optional Capabilities capabilities = 2;
repeated PermissionGrantDetails details = 3;
}
message ResponseStatus {
optional int32 status_code = 1;
optional string status_message = 2;
}
message PermissionIdentifier {
required PermissionIdentifierKind kind = 1;
optional string user_id = 2;
}
message PermissionEntry {
optional PermissionIdentifier identifier = 1;
optional Permission permission = 2;
}
message CreateInitialPermissions {
repeated PermissionEntry permission_entry = 1;
}
message CreateInitialPermissionsResponse {
repeated PermissionEntry permission_entry = 1;
}
message DefaultOwnerCapabilitiesResponse {
optional Capabilities capabilities = 1;
}
enum PermissionLevel {
UNKNOWN = 0;
BLOCKED = 1;
VIEWER = 2;
CONTRIBUTOR = 3;
MADE_FOR = 4;
}
enum PermissionIdentifierKind {
PERMISSION_IDENTIFIER_KIND_UNSPECIFIED = 0;
PERMISSION_IDENTIFIER_KIND_BASE = 1;
PERMISSION_IDENTIFIER_KIND_MEMBER = 2;
PERMISSION_IDENTIFIER_KIND_ABUSE = 3;
PERMISSION_IDENTIFIER_KIND_PROFILE = 4;
PERMISSION_IDENTIFIER_KIND_AUTHORIZED = 5;
}