vendor: update all dependencies
* Update all dependencies * Remove all `[[constraint]]` from Gopkg.toml * Add in the minimum number of `[[override]]` to build * Remove go get of github.com/inconshreveable/mousetrap as it is vendored * Update docs with new policy on constraints
This commit is contained in:
+2
-120
@@ -1505,82 +1505,6 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"topics": {
|
||||
"methods": {
|
||||
"get": {
|
||||
"description": "Returns a topic.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course or topic, or for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course or topic does not exist.",
|
||||
"flatPath": "v1/courses/{courseId}/topics/{id}",
|
||||
"httpMethod": "GET",
|
||||
"id": "classroom.courses.topics.get",
|
||||
"parameterOrder": [
|
||||
"courseId",
|
||||
"id"
|
||||
],
|
||||
"parameters": {
|
||||
"courseId": {
|
||||
"description": "Identifier of the course.",
|
||||
"location": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"description": "Identifier of the topic.",
|
||||
"location": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"path": "v1/courses/{courseId}/topics/{id}",
|
||||
"response": {
|
||||
"$ref": "Topic"
|
||||
},
|
||||
"scopes": [
|
||||
"https://www.googleapis.com/auth/classroom.coursework.me",
|
||||
"https://www.googleapis.com/auth/classroom.coursework.me.readonly",
|
||||
"https://www.googleapis.com/auth/classroom.coursework.students",
|
||||
"https://www.googleapis.com/auth/classroom.coursework.students.readonly"
|
||||
]
|
||||
},
|
||||
"list": {
|
||||
"description": "Returns the list of topics that the requester is permitted to view.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access\nthe requested course or for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course does not exist.",
|
||||
"flatPath": "v1/courses/{courseId}/topics",
|
||||
"httpMethod": "GET",
|
||||
"id": "classroom.courses.topics.list",
|
||||
"parameterOrder": [
|
||||
"courseId"
|
||||
],
|
||||
"parameters": {
|
||||
"courseId": {
|
||||
"description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.",
|
||||
"location": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
"pageSize": {
|
||||
"description": "Maximum number of items to return. Zero or unspecified indicates that the\nserver may assign a maximum.\n\nThe server may return fewer than the specified number of results.",
|
||||
"format": "int32",
|
||||
"location": "query",
|
||||
"type": "integer"
|
||||
},
|
||||
"pageToken": {
|
||||
"description": "nextPageToken\nvalue returned from a previous\nlist call,\nindicating that the subsequent page of results should be returned.\n\nThe list request\nmust be otherwise identical to the one that resulted in this token.",
|
||||
"location": "query",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"path": "v1/courses/{courseId}/topics",
|
||||
"response": {
|
||||
"$ref": "ListTopicResponse"
|
||||
},
|
||||
"scopes": [
|
||||
"https://www.googleapis.com/auth/classroom.coursework.me",
|
||||
"https://www.googleapis.com/auth/classroom.coursework.me.readonly",
|
||||
"https://www.googleapis.com/auth/classroom.coursework.students",
|
||||
"https://www.googleapis.com/auth/classroom.coursework.students.readonly"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -2066,7 +1990,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"revision": "20180203",
|
||||
"revision": "20180423",
|
||||
"rootUrl": "https://classroom.googleapis.com/",
|
||||
"schemas": {
|
||||
"Announcement": {
|
||||
@@ -2526,7 +2450,7 @@
|
||||
"type": "integer"
|
||||
},
|
||||
"month": {
|
||||
"description": "Month of year. Must be from 1 to 12.",
|
||||
"description": "Month of year. Must be from 1 to 12, or 0 if specifying a date without a\nmonth.",
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
},
|
||||
@@ -3004,24 +2928,6 @@
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"ListTopicResponse": {
|
||||
"description": "Response when listing topics.",
|
||||
"id": "ListTopicResponse",
|
||||
"properties": {
|
||||
"nextPageToken": {
|
||||
"description": "Token identifying the next page of results to return. If empty, no further\nresults are available.",
|
||||
"type": "string"
|
||||
},
|
||||
"topic": {
|
||||
"description": "Topic items that match the request.",
|
||||
"items": {
|
||||
"$ref": "Topic"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"Material": {
|
||||
"description": "Material attached to course work.\n\nWhen creating attachments, setting the `form` field is not supported.",
|
||||
"id": "Material",
|
||||
@@ -3478,30 +3384,6 @@
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"Topic": {
|
||||
"description": "Topic created by a teacher for the course",
|
||||
"id": "Topic",
|
||||
"properties": {
|
||||
"courseId": {
|
||||
"description": "Identifier of the course.\n\nRead-only.",
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the topic, generated by the user.\nLeading and trailing whitespaces, if any, will be trimmed. Also, multiple\nconsecutive whitespaces will be collapsed into one inside the name.\nTopic names are case sensitive, and must be no longer than 100 characters.",
|
||||
"type": "string"
|
||||
},
|
||||
"topicId": {
|
||||
"description": "Unique identifier for the topic.\n\nRead-only.",
|
||||
"type": "string"
|
||||
},
|
||||
"updateTime": {
|
||||
"description": "The time the topic was last updated by the system.\n\nRead-only.",
|
||||
"format": "google-datetime",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"TurnInStudentSubmissionRequest": {
|
||||
"description": "Request to turn in a student submission.",
|
||||
"id": "TurnInStudentSubmissionRequest",
|
||||
|
||||
+3
-469
@@ -147,7 +147,6 @@ func NewCoursesService(s *Service) *CoursesService {
|
||||
rs.CourseWork = NewCoursesCourseWorkService(s)
|
||||
rs.Students = NewCoursesStudentsService(s)
|
||||
rs.Teachers = NewCoursesTeachersService(s)
|
||||
rs.Topics = NewCoursesTopicsService(s)
|
||||
return rs
|
||||
}
|
||||
|
||||
@@ -163,8 +162,6 @@ type CoursesService struct {
|
||||
Students *CoursesStudentsService
|
||||
|
||||
Teachers *CoursesTeachersService
|
||||
|
||||
Topics *CoursesTopicsService
|
||||
}
|
||||
|
||||
func NewCoursesAliasesService(s *Service) *CoursesAliasesService {
|
||||
@@ -224,15 +221,6 @@ type CoursesTeachersService struct {
|
||||
s *Service
|
||||
}
|
||||
|
||||
func NewCoursesTopicsService(s *Service) *CoursesTopicsService {
|
||||
rs := &CoursesTopicsService{s: s}
|
||||
return rs
|
||||
}
|
||||
|
||||
type CoursesTopicsService struct {
|
||||
s *Service
|
||||
}
|
||||
|
||||
func NewInvitationsService(s *Service) *InvitationsService {
|
||||
rs := &InvitationsService{s: s}
|
||||
return rs
|
||||
@@ -1153,7 +1141,9 @@ type Date struct {
|
||||
// if specifying a year/month where the day is not significant.
|
||||
Day int64 `json:"day,omitempty"`
|
||||
|
||||
// Month: Month of year. Must be from 1 to 12.
|
||||
// Month: Month of year. Must be from 1 to 12, or 0 if specifying a date
|
||||
// without a
|
||||
// month.
|
||||
Month int64 `json:"month,omitempty"`
|
||||
|
||||
// Year: Year of date. Must be from 1 to 9999, or 0 if specifying a date
|
||||
@@ -2109,43 +2099,6 @@ func (s *ListTeachersResponse) MarshalJSON() ([]byte, error) {
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
// ListTopicResponse: Response when listing topics.
|
||||
type ListTopicResponse struct {
|
||||
// NextPageToken: Token identifying the next page of results to return.
|
||||
// If empty, no further
|
||||
// results are available.
|
||||
NextPageToken string `json:"nextPageToken,omitempty"`
|
||||
|
||||
// Topic: Topic items that match the request.
|
||||
Topic []*Topic `json:"topic,omitempty"`
|
||||
|
||||
// ServerResponse contains the HTTP response code and headers from the
|
||||
// server.
|
||||
googleapi.ServerResponse `json:"-"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "NextPageToken") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "NextPageToken") to include
|
||||
// in API requests with the JSON null value. By default, fields with
|
||||
// empty values are omitted from API requests. However, any field with
|
||||
// an empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *ListTopicResponse) MarshalJSON() ([]byte, error) {
|
||||
type NoMethod ListTopicResponse
|
||||
raw := NoMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
// Material: Material attached to course work.
|
||||
//
|
||||
// When creating attachments, setting the `form` field is not supported.
|
||||
@@ -2994,60 +2947,6 @@ func (s *TimeOfDay) MarshalJSON() ([]byte, error) {
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
// Topic: Topic created by a teacher for the course
|
||||
type Topic struct {
|
||||
// CourseId: Identifier of the course.
|
||||
//
|
||||
// Read-only.
|
||||
CourseId string `json:"courseId,omitempty"`
|
||||
|
||||
// Name: The name of the topic, generated by the user.
|
||||
// Leading and trailing whitespaces, if any, will be trimmed. Also,
|
||||
// multiple
|
||||
// consecutive whitespaces will be collapsed into one inside the
|
||||
// name.
|
||||
// Topic names are case sensitive, and must be no longer than 100
|
||||
// characters.
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// TopicId: Unique identifier for the topic.
|
||||
//
|
||||
// Read-only.
|
||||
TopicId string `json:"topicId,omitempty"`
|
||||
|
||||
// UpdateTime: The time the topic was last updated by the
|
||||
// system.
|
||||
//
|
||||
// Read-only.
|
||||
UpdateTime string `json:"updateTime,omitempty"`
|
||||
|
||||
// ServerResponse contains the HTTP response code and headers from the
|
||||
// server.
|
||||
googleapi.ServerResponse `json:"-"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "CourseId") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "CourseId") to include in
|
||||
// API requests with the JSON null value. By default, fields with empty
|
||||
// values are omitted from API requests. However, any field with an
|
||||
// empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *Topic) MarshalJSON() ([]byte, error) {
|
||||
type NoMethod Topic
|
||||
raw := NoMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
// TurnInStudentSubmissionRequest: Request to turn in a student
|
||||
// submission.
|
||||
type TurnInStudentSubmissionRequest struct {
|
||||
@@ -9510,371 +9409,6 @@ func (c *CoursesTeachersListCall) Pages(ctx context.Context, f func(*ListTeacher
|
||||
}
|
||||
}
|
||||
|
||||
// method id "classroom.courses.topics.get":
|
||||
|
||||
type CoursesTopicsGetCall struct {
|
||||
s *Service
|
||||
courseId string
|
||||
id string
|
||||
urlParams_ gensupport.URLParams
|
||||
ifNoneMatch_ string
|
||||
ctx_ context.Context
|
||||
header_ http.Header
|
||||
}
|
||||
|
||||
// Get: Returns a topic.
|
||||
//
|
||||
// This method returns the following error codes:
|
||||
//
|
||||
// * `PERMISSION_DENIED` if the requesting user is not permitted to
|
||||
// access the
|
||||
// requested course or topic, or for access errors.
|
||||
// * `INVALID_ARGUMENT` if the request is malformed.
|
||||
// * `NOT_FOUND` if the requested course or topic does not exist.
|
||||
func (r *CoursesTopicsService) Get(courseId string, id string) *CoursesTopicsGetCall {
|
||||
c := &CoursesTopicsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
|
||||
c.courseId = courseId
|
||||
c.id = id
|
||||
return c
|
||||
}
|
||||
|
||||
// Fields allows partial responses to be retrieved. See
|
||||
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
|
||||
// for more information.
|
||||
func (c *CoursesTopicsGetCall) Fields(s ...googleapi.Field) *CoursesTopicsGetCall {
|
||||
c.urlParams_.Set("fields", googleapi.CombineFields(s))
|
||||
return c
|
||||
}
|
||||
|
||||
// IfNoneMatch sets the optional parameter which makes the operation
|
||||
// fail if the object's ETag matches the given value. This is useful for
|
||||
// getting updates only after the object has changed since the last
|
||||
// request. Use googleapi.IsNotModified to check whether the response
|
||||
// error from Do is the result of In-None-Match.
|
||||
func (c *CoursesTopicsGetCall) IfNoneMatch(entityTag string) *CoursesTopicsGetCall {
|
||||
c.ifNoneMatch_ = entityTag
|
||||
return c
|
||||
}
|
||||
|
||||
// Context sets the context to be used in this call's Do method. Any
|
||||
// pending HTTP request will be aborted if the provided context is
|
||||
// canceled.
|
||||
func (c *CoursesTopicsGetCall) Context(ctx context.Context) *CoursesTopicsGetCall {
|
||||
c.ctx_ = ctx
|
||||
return c
|
||||
}
|
||||
|
||||
// Header returns an http.Header that can be modified by the caller to
|
||||
// add HTTP headers to the request.
|
||||
func (c *CoursesTopicsGetCall) Header() http.Header {
|
||||
if c.header_ == nil {
|
||||
c.header_ = make(http.Header)
|
||||
}
|
||||
return c.header_
|
||||
}
|
||||
|
||||
func (c *CoursesTopicsGetCall) doRequest(alt string) (*http.Response, error) {
|
||||
reqHeaders := make(http.Header)
|
||||
for k, v := range c.header_ {
|
||||
reqHeaders[k] = v
|
||||
}
|
||||
reqHeaders.Set("User-Agent", c.s.userAgent())
|
||||
if c.ifNoneMatch_ != "" {
|
||||
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
|
||||
}
|
||||
var body io.Reader = nil
|
||||
c.urlParams_.Set("alt", alt)
|
||||
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/topics/{id}")
|
||||
urls += "?" + c.urlParams_.Encode()
|
||||
req, _ := http.NewRequest("GET", urls, body)
|
||||
req.Header = reqHeaders
|
||||
googleapi.Expand(req.URL, map[string]string{
|
||||
"courseId": c.courseId,
|
||||
"id": c.id,
|
||||
})
|
||||
return gensupport.SendRequest(c.ctx_, c.s.client, req)
|
||||
}
|
||||
|
||||
// Do executes the "classroom.courses.topics.get" call.
|
||||
// Exactly one of *Topic or error will be non-nil. Any non-2xx status
|
||||
// code is an error. Response headers are in either
|
||||
// *Topic.ServerResponse.Header or (if a response was returned at all)
|
||||
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
|
||||
// check whether the returned error was because http.StatusNotModified
|
||||
// was returned.
|
||||
func (c *CoursesTopicsGetCall) Do(opts ...googleapi.CallOption) (*Topic, error) {
|
||||
gensupport.SetOptions(c.urlParams_, opts...)
|
||||
res, err := c.doRequest("json")
|
||||
if res != nil && res.StatusCode == http.StatusNotModified {
|
||||
if res.Body != nil {
|
||||
res.Body.Close()
|
||||
}
|
||||
return nil, &googleapi.Error{
|
||||
Code: res.StatusCode,
|
||||
Header: res.Header,
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer googleapi.CloseBody(res)
|
||||
if err := googleapi.CheckResponse(res); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ret := &Topic{
|
||||
ServerResponse: googleapi.ServerResponse{
|
||||
Header: res.Header,
|
||||
HTTPStatusCode: res.StatusCode,
|
||||
},
|
||||
}
|
||||
target := &ret
|
||||
if err := gensupport.DecodeResponse(target, res); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ret, nil
|
||||
// {
|
||||
// "description": "Returns a topic.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course or topic, or for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course or topic does not exist.",
|
||||
// "flatPath": "v1/courses/{courseId}/topics/{id}",
|
||||
// "httpMethod": "GET",
|
||||
// "id": "classroom.courses.topics.get",
|
||||
// "parameterOrder": [
|
||||
// "courseId",
|
||||
// "id"
|
||||
// ],
|
||||
// "parameters": {
|
||||
// "courseId": {
|
||||
// "description": "Identifier of the course.",
|
||||
// "location": "path",
|
||||
// "required": true,
|
||||
// "type": "string"
|
||||
// },
|
||||
// "id": {
|
||||
// "description": "Identifier of the topic.",
|
||||
// "location": "path",
|
||||
// "required": true,
|
||||
// "type": "string"
|
||||
// }
|
||||
// },
|
||||
// "path": "v1/courses/{courseId}/topics/{id}",
|
||||
// "response": {
|
||||
// "$ref": "Topic"
|
||||
// },
|
||||
// "scopes": [
|
||||
// "https://www.googleapis.com/auth/classroom.coursework.me",
|
||||
// "https://www.googleapis.com/auth/classroom.coursework.me.readonly",
|
||||
// "https://www.googleapis.com/auth/classroom.coursework.students",
|
||||
// "https://www.googleapis.com/auth/classroom.coursework.students.readonly"
|
||||
// ]
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
// method id "classroom.courses.topics.list":
|
||||
|
||||
type CoursesTopicsListCall struct {
|
||||
s *Service
|
||||
courseId string
|
||||
urlParams_ gensupport.URLParams
|
||||
ifNoneMatch_ string
|
||||
ctx_ context.Context
|
||||
header_ http.Header
|
||||
}
|
||||
|
||||
// List: Returns the list of topics that the requester is permitted to
|
||||
// view.
|
||||
//
|
||||
// This method returns the following error codes:
|
||||
//
|
||||
// * `PERMISSION_DENIED` if the requesting user is not permitted to
|
||||
// access
|
||||
// the requested course or for access errors.
|
||||
// * `INVALID_ARGUMENT` if the request is malformed.
|
||||
// * `NOT_FOUND` if the requested course does not exist.
|
||||
func (r *CoursesTopicsService) List(courseId string) *CoursesTopicsListCall {
|
||||
c := &CoursesTopicsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
|
||||
c.courseId = courseId
|
||||
return c
|
||||
}
|
||||
|
||||
// PageSize sets the optional parameter "pageSize": Maximum number of
|
||||
// items to return. Zero or unspecified indicates that the
|
||||
// server may assign a maximum.
|
||||
//
|
||||
// The server may return fewer than the specified number of results.
|
||||
func (c *CoursesTopicsListCall) PageSize(pageSize int64) *CoursesTopicsListCall {
|
||||
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
|
||||
return c
|
||||
}
|
||||
|
||||
// PageToken sets the optional parameter "pageToken":
|
||||
// nextPageToken
|
||||
// value returned from a previous
|
||||
// list call,
|
||||
// indicating that the subsequent page of results should be
|
||||
// returned.
|
||||
//
|
||||
// The list request
|
||||
// must be otherwise identical to the one that resulted in this token.
|
||||
func (c *CoursesTopicsListCall) PageToken(pageToken string) *CoursesTopicsListCall {
|
||||
c.urlParams_.Set("pageToken", pageToken)
|
||||
return c
|
||||
}
|
||||
|
||||
// Fields allows partial responses to be retrieved. See
|
||||
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
|
||||
// for more information.
|
||||
func (c *CoursesTopicsListCall) Fields(s ...googleapi.Field) *CoursesTopicsListCall {
|
||||
c.urlParams_.Set("fields", googleapi.CombineFields(s))
|
||||
return c
|
||||
}
|
||||
|
||||
// IfNoneMatch sets the optional parameter which makes the operation
|
||||
// fail if the object's ETag matches the given value. This is useful for
|
||||
// getting updates only after the object has changed since the last
|
||||
// request. Use googleapi.IsNotModified to check whether the response
|
||||
// error from Do is the result of In-None-Match.
|
||||
func (c *CoursesTopicsListCall) IfNoneMatch(entityTag string) *CoursesTopicsListCall {
|
||||
c.ifNoneMatch_ = entityTag
|
||||
return c
|
||||
}
|
||||
|
||||
// Context sets the context to be used in this call's Do method. Any
|
||||
// pending HTTP request will be aborted if the provided context is
|
||||
// canceled.
|
||||
func (c *CoursesTopicsListCall) Context(ctx context.Context) *CoursesTopicsListCall {
|
||||
c.ctx_ = ctx
|
||||
return c
|
||||
}
|
||||
|
||||
// Header returns an http.Header that can be modified by the caller to
|
||||
// add HTTP headers to the request.
|
||||
func (c *CoursesTopicsListCall) Header() http.Header {
|
||||
if c.header_ == nil {
|
||||
c.header_ = make(http.Header)
|
||||
}
|
||||
return c.header_
|
||||
}
|
||||
|
||||
func (c *CoursesTopicsListCall) doRequest(alt string) (*http.Response, error) {
|
||||
reqHeaders := make(http.Header)
|
||||
for k, v := range c.header_ {
|
||||
reqHeaders[k] = v
|
||||
}
|
||||
reqHeaders.Set("User-Agent", c.s.userAgent())
|
||||
if c.ifNoneMatch_ != "" {
|
||||
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
|
||||
}
|
||||
var body io.Reader = nil
|
||||
c.urlParams_.Set("alt", alt)
|
||||
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/topics")
|
||||
urls += "?" + c.urlParams_.Encode()
|
||||
req, _ := http.NewRequest("GET", urls, body)
|
||||
req.Header = reqHeaders
|
||||
googleapi.Expand(req.URL, map[string]string{
|
||||
"courseId": c.courseId,
|
||||
})
|
||||
return gensupport.SendRequest(c.ctx_, c.s.client, req)
|
||||
}
|
||||
|
||||
// Do executes the "classroom.courses.topics.list" call.
|
||||
// Exactly one of *ListTopicResponse or error will be non-nil. Any
|
||||
// non-2xx status code is an error. Response headers are in either
|
||||
// *ListTopicResponse.ServerResponse.Header or (if a response was
|
||||
// returned at all) in error.(*googleapi.Error).Header. Use
|
||||
// googleapi.IsNotModified to check whether the returned error was
|
||||
// because http.StatusNotModified was returned.
|
||||
func (c *CoursesTopicsListCall) Do(opts ...googleapi.CallOption) (*ListTopicResponse, error) {
|
||||
gensupport.SetOptions(c.urlParams_, opts...)
|
||||
res, err := c.doRequest("json")
|
||||
if res != nil && res.StatusCode == http.StatusNotModified {
|
||||
if res.Body != nil {
|
||||
res.Body.Close()
|
||||
}
|
||||
return nil, &googleapi.Error{
|
||||
Code: res.StatusCode,
|
||||
Header: res.Header,
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer googleapi.CloseBody(res)
|
||||
if err := googleapi.CheckResponse(res); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ret := &ListTopicResponse{
|
||||
ServerResponse: googleapi.ServerResponse{
|
||||
Header: res.Header,
|
||||
HTTPStatusCode: res.StatusCode,
|
||||
},
|
||||
}
|
||||
target := &ret
|
||||
if err := gensupport.DecodeResponse(target, res); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ret, nil
|
||||
// {
|
||||
// "description": "Returns the list of topics that the requester is permitted to view.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access\nthe requested course or for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course does not exist.",
|
||||
// "flatPath": "v1/courses/{courseId}/topics",
|
||||
// "httpMethod": "GET",
|
||||
// "id": "classroom.courses.topics.list",
|
||||
// "parameterOrder": [
|
||||
// "courseId"
|
||||
// ],
|
||||
// "parameters": {
|
||||
// "courseId": {
|
||||
// "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.",
|
||||
// "location": "path",
|
||||
// "required": true,
|
||||
// "type": "string"
|
||||
// },
|
||||
// "pageSize": {
|
||||
// "description": "Maximum number of items to return. Zero or unspecified indicates that the\nserver may assign a maximum.\n\nThe server may return fewer than the specified number of results.",
|
||||
// "format": "int32",
|
||||
// "location": "query",
|
||||
// "type": "integer"
|
||||
// },
|
||||
// "pageToken": {
|
||||
// "description": "nextPageToken\nvalue returned from a previous\nlist call,\nindicating that the subsequent page of results should be returned.\n\nThe list request\nmust be otherwise identical to the one that resulted in this token.",
|
||||
// "location": "query",
|
||||
// "type": "string"
|
||||
// }
|
||||
// },
|
||||
// "path": "v1/courses/{courseId}/topics",
|
||||
// "response": {
|
||||
// "$ref": "ListTopicResponse"
|
||||
// },
|
||||
// "scopes": [
|
||||
// "https://www.googleapis.com/auth/classroom.coursework.me",
|
||||
// "https://www.googleapis.com/auth/classroom.coursework.me.readonly",
|
||||
// "https://www.googleapis.com/auth/classroom.coursework.students",
|
||||
// "https://www.googleapis.com/auth/classroom.coursework.students.readonly"
|
||||
// ]
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
// Pages invokes f for each page of results.
|
||||
// A non-nil error returned from f will halt the iteration.
|
||||
// The provided context supersedes any context provided to the Context method.
|
||||
func (c *CoursesTopicsListCall) Pages(ctx context.Context, f func(*ListTopicResponse) error) error {
|
||||
c.ctx_ = ctx
|
||||
defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
|
||||
for {
|
||||
x, err := c.Do()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := f(x); err != nil {
|
||||
return err
|
||||
}
|
||||
if x.NextPageToken == "" {
|
||||
return nil
|
||||
}
|
||||
c.PageToken(x.NextPageToken)
|
||||
}
|
||||
}
|
||||
|
||||
// method id "classroom.invitations.accept":
|
||||
|
||||
type InvitationsAcceptCall struct {
|
||||
|
||||
Reference in New Issue
Block a user