1
/* Copyright (c) 2007 Google Inc.
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at
7
* http://www.apache.org/licenses/LICENSE-2.0
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License.
19
using System.Collections;
20
using Google.GData.Client;
21
using Google.GData.Extensions.Apps;
23
namespace Google.GData.Apps
26
/// A Google Apps email list entry. An EmailListEntry object
27
/// contains information about a single email list.
29
public class EmailListEntry : AbstractEntry
32
/// Category used to label entries that contain email list
35
public static readonly AtomCategory EMAILLIST_CATEGORY =
36
new AtomCategory(AppsNameTable.EmailList,
37
new AtomUri(BaseNameTable.gKind));
40
/// Constructs a new EmailListEntry instance with the appropriate category
41
/// to indicate that it is a email list.
43
public EmailListEntry()
46
Categories.Add(EMAILLIST_CATEGORY);
48
GAppsExtensions.AddProvisioningExtensions(this);
52
/// Constructs a new EmailListEntry instance with the specified list name.
54
/// <param name="emailListName">the name of the email list</param>
55
public EmailListEntry(String emailListName)
58
Categories.Add(EMAILLIST_CATEGORY);
60
GAppsExtensions.AddProvisioningExtensions(this);
62
EmailList = new EmailListElement(emailListName);
66
/// The email list element in this entry.
68
public EmailListElement EmailList
72
return FindExtension(AppsNameTable.AppsEmailList,
73
AppsNameTable.AppsNamespace) as EmailListElement;
77
ReplaceExtension(AppsNameTable.AppsEmailList,
78
AppsNameTable.AppsNamespace,
84
/// Overrides the base Update() method to throw a ClientFeedException,
85
/// because email list entries cannot be updated. This exception
86
/// indicates that the client made an erroneous request to the email
89
public new void Update()
91
throw new ClientFeedException("Email list entries cannot be updated.");