Sha256: e6e4b9c67ec6add21881c22dcadf9dbcc397ee567787e9662347318ee3bb91bf

Contents?: true

Size: 921 Bytes

Versions: 15

Compression:

Stored size: 921 Bytes

Contents

# frozen_string_literal: true

module GithubApi
  class Client
    # Methods for the Issues API
    module Milestones
      def list_milestones(repo, params)
        JSON.parse(
          Http::Client::Request.get(
            "https://api.github.com/repos/#{repo}/milestones?per_page=100",
            {
              "Authorization" => "token #{@token}",
              params: params
            }
          )
        )
      end
      alias milestones list_milestones

      def create_milestone(repo, params)
        JSON.parse(
          Http::Client::Request.post(
            "https://api.github.com/repos/#{repo}/milestones",
            params.to_json,
            {
              "Authorization" => "token #{@token}",
              "Content-Type" => "application/json",
              "Accept" => "application/vnd.github.golden-comet-preview+json"
            }
          )
        )
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
tractive-1.0.26 lib/tractive/github_api/client/milestones.rb
tractive-1.0.25 lib/tractive/github_api/client/milestones.rb
tractive-1.0.22 lib/tractive/github_api/client/milestones.rb
tractive-1.0.21 lib/tractive/github_api/client/milestones.rb
tractive-1.0.20 lib/tractive/github_api/client/milestones.rb
tractive-1.0.19 lib/tractive/github_api/client/milestones.rb
tractive-1.0.18 lib/tractive/github_api/client/milestones.rb
tractive-1.0.17 lib/tractive/github_api/client/milestones.rb
tractive-1.0.16 lib/tractive/github_api/client/milestones.rb
tractive-1.0.15 lib/tractive/github_api/client/milestones.rb
tractive-1.0.14 lib/tractive/github_api/client/milestones.rb
tractive-1.0.13 lib/tractive/github_api/client/milestones.rb
tractive-1.0.12 lib/tractive/github_api/client/milestones.rb
tractive-1.0.11 lib/tractive/github_api/client/milestones.rb
tractive-1.0.10 lib/tractive/github_api/client/milestones.rb