Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions lib/discord/v1/cache.pb.ex
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,30 @@ defmodule Pylon.Discord.V1.Cache.GetGuildMemberResponse do
field :member, 1, type: Pylon.Discord.V1.Model.MemberData
end

defmodule Pylon.Discord.V1.Cache.GetGuildMemberPresenceRequest do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
user_id: non_neg_integer
}
defstruct [:user_id]

field :user_id, 1, type: :fixed64
end

defmodule Pylon.Discord.V1.Cache.GetGuildMemberPresenceResponse do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
presence: Pylon.Discord.V1.Model.PresenceData.t() | nil
}
defstruct [:presence]

field :presence, 1, type: Pylon.Discord.V1.Model.PresenceData
end

defmodule Pylon.Discord.V1.Cache.ListGuildRolesRequest do
@moduledoc false
use Protobuf, syntax: :proto3
Expand Down
119 changes: 119 additions & 0 deletions lib/discord/v1/gateway.pb.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
defmodule Pylon.Discord.V1.Gateway.UpdateVoiceStateRequest do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
guild_id: non_neg_integer,
channel_id: non_neg_integer,
self_mute: boolean,
self_deaf: boolean
}
defstruct [:guild_id, :channel_id, :self_mute, :self_deaf]

field :guild_id, 1, type: :fixed64
field :channel_id, 2, type: :fixed64
field :self_mute, 3, type: :bool
field :self_deaf, 4, type: :bool
end

defmodule Pylon.Discord.V1.Gateway.UpdateVoiceStateResponse do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{}
defstruct []
end

defmodule Pylon.Discord.V1.Gateway.UpdateStatusRequest.ActivityData do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
name: String.t(),
type: non_neg_integer
}
defstruct [:name, :type]

field :name, 1, type: :string
field :type, 2, type: :uint32
end

defmodule Pylon.Discord.V1.Gateway.UpdateStatusRequest do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
shard_id: Google.Protobuf.UInt32Value.t() | nil,
since: Google.Protobuf.Timestamp.t() | nil,
activities: [Pylon.Discord.V1.Gateway.UpdateStatusRequest.ActivityData.t()],
status: String.t(),
afk: boolean
}
defstruct [:shard_id, :since, :activities, :status, :afk]

field :shard_id, 1, type: Google.Protobuf.UInt32Value
field :since, 2, type: Google.Protobuf.Timestamp

field :activities, 3,
repeated: true,
type: Pylon.Discord.V1.Gateway.UpdateStatusRequest.ActivityData

field :status, 4, type: :string
field :afk, 5, type: :bool
end

defmodule Pylon.Discord.V1.Gateway.UpdateStatusResponse do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{}
defstruct []
end

defmodule Pylon.Discord.V1.Gateway.GetUserMutualGuildsRequest do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
user_id: non_neg_integer
}
defstruct [:user_id]

field :user_id, 1, type: :fixed64
end

defmodule Pylon.Discord.V1.Gateway.GetUserMutualGuildsResponse do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
guilds: [Pylon.Discord.V1.Model.GuildData.t()]
}
defstruct [:guilds]

field :guilds, 1, repeated: true, type: Pylon.Discord.V1.Model.GuildData
end

defmodule Pylon.Discord.V1.Gateway.FindEmojiRequest do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
emoji_id: non_neg_integer
}
defstruct [:emoji_id]

field :emoji_id, 1, type: :fixed64
end

defmodule Pylon.Discord.V1.Gateway.FindEmojiResponse do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
emoji: Pylon.Discord.V1.Model.EmojiData.t() | nil
}
defstruct [:emoji]

field :emoji, 1, type: Pylon.Discord.V1.Model.EmojiData
end
183 changes: 179 additions & 4 deletions lib/discord/v1/rest.pb.ex
Original file line number Diff line number Diff line change
@@ -1,19 +1,108 @@
defmodule Pylon.Discord.V1.Rest.RestError do
defmodule Pylon.Discord.V1.Rest.RestError.UnknownError do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
status: non_neg_integer,
http_status: non_neg_integer,
code: non_neg_integer,
message: String.t()
}
defstruct [:status, :code, :message]
defstruct [:http_status, :code, :message]

field :status, 1, type: :uint32
field :http_status, 1, type: :uint32
field :code, 2, type: :uint32
field :message, 3, type: :string
end

defmodule Pylon.Discord.V1.Rest.RestError.ValidationError.Field do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
path: String.t(),
code: String.t(),
message: String.t()
}
defstruct [:path, :code, :message]

field :path, 1, type: :string
field :code, 2, type: :string
field :message, 3, type: :string
end

defmodule Pylon.Discord.V1.Rest.RestError.ValidationError do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
message: String.t(),
fields: [Pylon.Discord.V1.Rest.RestError.ValidationError.Field.t()]
}
defstruct [:message, :fields]

field :message, 1, type: :string
field :fields, 2, repeated: true, type: Pylon.Discord.V1.Rest.RestError.ValidationError.Field
end

defmodule Pylon.Discord.V1.Rest.RestError.ResourceNotFound do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
code: non_neg_integer,
message: String.t()
}
defstruct [:code, :message]

field :code, 1, type: :uint32
field :message, 2, type: :string
end

defmodule Pylon.Discord.V1.Rest.RestError.AccessDenied do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
code: non_neg_integer,
message: String.t()
}
defstruct [:code, :message]

field :code, 1, type: :uint32
field :message, 2, type: :string
end

defmodule Pylon.Discord.V1.Rest.RestError.RateLimited do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
global: boolean,
retry_at: non_neg_integer
}
defstruct [:global, :retry_at]

field :global, 1, type: :bool
field :retry_at, 2, type: :uint32
end

defmodule Pylon.Discord.V1.Rest.RestError do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
error_type: {atom, any}
}
defstruct [:error_type]

oneof :error_type, 0
field :unknown_error, 1, type: Pylon.Discord.V1.Rest.RestError.UnknownError, oneof: 0
field :validation_error, 2, type: Pylon.Discord.V1.Rest.RestError.ValidationError, oneof: 0
field :resource_not_found, 3, type: Pylon.Discord.V1.Rest.RestError.ResourceNotFound, oneof: 0
field :access_denied, 4, type: Pylon.Discord.V1.Rest.RestError.AccessDenied, oneof: 0
field :rate_limited, 5, type: Pylon.Discord.V1.Rest.RestError.RateLimited, oneof: 0
end

defmodule Pylon.Discord.V1.Rest.ModifyGuildRequest do
@moduledoc false
use Protobuf, syntax: :proto3
Expand Down Expand Up @@ -980,6 +1069,92 @@ defmodule Pylon.Discord.V1.Rest.DeleteChannelResponse do
field :data, 2, type: Google.Protobuf.Empty, oneof: 0
end

defmodule Pylon.Discord.V1.Rest.GetChannelMessagesRequest do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
channel_id: non_neg_integer,
around: Pylon.Discord.V1.Model.SnowflakeValue.t() | nil,
before: Pylon.Discord.V1.Model.SnowflakeValue.t() | nil,
after: Pylon.Discord.V1.Model.SnowflakeValue.t() | nil,
limit: non_neg_integer
}
defstruct [:channel_id, :around, :before, :after, :limit]

field :channel_id, 1, type: :fixed64
field :around, 2, type: Pylon.Discord.V1.Model.SnowflakeValue
field :before, 3, type: Pylon.Discord.V1.Model.SnowflakeValue
field :after, 4, type: Pylon.Discord.V1.Model.SnowflakeValue
field :limit, 5, type: :uint32
end

defmodule Pylon.Discord.V1.Rest.GetChannelMessagesResponse.Data do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
messages: [Pylon.Discord.V1.Model.MessageData.t()]
}
defstruct [:messages]

field :messages, 1, repeated: true, type: Pylon.Discord.V1.Model.MessageData
end

defmodule Pylon.Discord.V1.Rest.GetChannelMessagesResponse do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
response: {atom, any}
}
defstruct [:response]

oneof :response, 0
field :error, 1, type: Pylon.Discord.V1.Rest.RestError, oneof: 0
field :data, 2, type: Pylon.Discord.V1.Rest.GetChannelMessagesResponse.Data, oneof: 0
end

defmodule Pylon.Discord.V1.Rest.GetChannelMessageRequest do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
channel_id: non_neg_integer,
message_id: non_neg_integer
}
defstruct [:channel_id, :message_id]

field :channel_id, 1, type: :fixed64
field :message_id, 2, type: :fixed64
end

defmodule Pylon.Discord.V1.Rest.GetChannelMessageResponse.Data do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
message: Pylon.Discord.V1.Model.MessageData.t() | nil
}
defstruct [:message]

field :message, 1, type: Pylon.Discord.V1.Model.MessageData
end

defmodule Pylon.Discord.V1.Rest.GetChannelMessageResponse do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
response: {atom, any}
}
defstruct [:response]

oneof :response, 0
field :error, 1, type: Pylon.Discord.V1.Rest.RestError, oneof: 0
field :data, 2, type: Pylon.Discord.V1.Rest.GetChannelMessageResponse.Data, oneof: 0
end

defmodule Pylon.Discord.V1.Rest.CreateMessageRequest.AllowedMentions.AllowedMentionTypes do
@moduledoc false
use Protobuf, syntax: :proto3
Expand Down
25 changes: 25 additions & 0 deletions lib/gateway/v1/gateway_service.pb.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
defmodule Pylon.Gateway.V1.Service.Gateway.Service do
@moduledoc false
use GRPC.Service, name: "pylon.gateway.v1.service.Gateway"

rpc :UpdateVoiceState,
Pylon.Discord.V1.Gateway.UpdateVoiceStateRequest,
Pylon.Discord.V1.Gateway.UpdateVoiceStateResponse

rpc :UpdateStatus,
Pylon.Discord.V1.Gateway.UpdateStatusRequest,
Pylon.Discord.V1.Gateway.UpdateStatusResponse

rpc :FindUserMutualGuilds,
Pylon.Discord.V1.Gateway.GetUserMutualGuildsRequest,
Pylon.Discord.V1.Gateway.GetUserMutualGuildsResponse

rpc :FindEmoji,
Pylon.Discord.V1.Gateway.FindEmojiRequest,
Pylon.Discord.V1.Gateway.FindEmojiResponse
end

defmodule Pylon.Gateway.V1.Service.Gateway.Stub do
@moduledoc false
use GRPC.Stub, service: Pylon.Gateway.V1.Service.Gateway.Service
end