Skip to content

Commit f3a863a

Browse files
authored
Merge pull request googleworkspace#167 from lesley2958/master
Create createAlias.gs
2 parents 49c917f + d6d2804 commit f3a863a

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

classroom/snippets/createAlias.gs

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Copyright Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
// [START classroom_create_alias]
17+
/**
18+
* Creates Course with an alias specified
19+
*/
20+
function createAlias() {
21+
var course = {
22+
id: 'p:10th_bio',
23+
name: '10th Grade Biology',
24+
section: 'Period 2',
25+
descriptionHeading: 'Welcome to 10th Grade Biology',
26+
description: "We'll be learning about about the structure of living creatures from a combination of textbooks, guest lectures, and lab work. Expect to be excited!",
27+
room: '301',
28+
ownerId: 'me',
29+
courseState: 'PROVISIONED'
30+
};
31+
var course = Classroom.Courses.create(course);
32+
Logger.log('Course created: %s (%s)', course.name, course.id)
33+
}
34+
// [END classroom_create_alias]

0 commit comments

Comments
 (0)