lib/trav3.rb in trav3-0.5.1 vs lib/trav3.rb in trav3-1.0.0

- old
+ new

@@ -98,10 +98,12 @@ self.repository = repo initial_defaults end + # @!group Request Parameters + # Set as the API endpoint # # @param endpoint [String] name for value to set # @return [Travis] def api_endpoint=(endpoint) @@ -149,10 +151,14 @@ def repository=(repo_name) validate_repo_format repo_name @repo = sanitize_repo_name repo_name end + # @!endgroup + + # @!group API Endpoints + # Please Note that the naming of this endpoint may be changed. Our naming convention for this information is in flux. If you have suggestions for how this information should be presented please leave us feedback by commenting in this issue here or emailing support support@travis-ci.com. # # A list of all the builds in an "active" state, either created or started. # # ## Attributes @@ -360,10 +366,50 @@ validate_number user_id get("#{without_repo}/user/#{user_id}/beta_features") end + # Request migration to beta + # + # ## Attributes + # Name Type Description + # id Unknown The beta_migration_request's id. + # owner_id Unknown The beta_migration_request's owner_id. + # owner_name Unknown The beta_migration_request's owner_name. + # owner_type Unknown The beta_migration_request's owner_type. + # accepted_at Unknown The beta_migration_request's accepted_at. + # organizations Unknown The beta_migration_request's organizations. + # + # ## Actions + # + # **Create** + # + # Submits a request for beta migration + # + # POST <code>/user/{user.id}/beta_migration_request</code> + # + # Template Variable Type Description + # user.id Integer Value uniquely identifying the user. + # Accepted Parameter Type Description + # beta_migration_request.organizations Unknown The beta_migration_request's organizations. + # + # Example: POST /user/119240/beta_migration_request + # + # ```ruby + # # RUBY EXAMPLE + # travis = Trav3::Travis.new('danielpclark/trav3') + # travis.beta_migration_request(119_240) + # ``` + # + # @note requests require an authorization token set in the headers. See: {authorization=} + # + # @param user_id [String, Integer] user id + # @return [Success, RequestError] + def beta_migration_request(user_id) + create("#{without_repo}/user/#{user_id}/beta_migration_request") + end + # The branch of a GitHub repository. Useful for obtaining information about the last build on a given branch. # # **If querying using the repository slug, it must be formatted using {http://www.w3schools.com/tags/ref_urlencode.asp standard URL encoding}, including any special characters.** # # ## Attributes @@ -1023,11 +1069,11 @@ # # @param delete [Boolean] option for deleting cache(s) # @return [Success, RequestError] def caches(delete = false) without_limit do - delete and return delete("#{with_repo}/caches#{opts}") + :delete.==(delete) and return delete("#{with_repo}/caches#{opts}") get("#{with_repo}/caches#{opts}") end end # An individual cron. There can be only one cron per branch on a repository. @@ -3653,9 +3699,11 @@ validate_number user_id sync and return post("#{without_repo}/user/#{user_id}/sync") get("#{without_repo}/user/#{user_id}") end + + # @!endgroup private # @private def create(url, data = {}) Trav3::REST.create(self, url, data)