context: // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
  // the License. You may obtain a copy of the License at
  //
  // http://www.apache.org/licenses/LICENSE-2.0
  //
  // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
  // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
  // specific language governing permissions and limitations under the License.
  
  //------------------------------------------------------------------------------
  // <auto-generated>
  //     This code was generated by google-apis-code-generator 1.5.1
  //     C# generator version: 1.10.0
  //
  //     Changes to this file may cause incorrect behavior and will be lost if
  //     the code is regenerated.
  // </auto-generated>
  //------------------------------------------------------------------------------
  
  /**
   * \mainpage
   *   Admin Reports API Version reports_v1
   *
   * \section ApiInfo API Version Information
   *    <table>
   *      <tr><th>API
   *          <td><a href='https://developers.google.com/admin-sdk/reports/'>Admin Reports API</a>
   *      <tr><th>API Version<td>reports_v1
   *      <tr><th>API Rev<td>0
   *      <tr><th>API Docs
   *          <td><a href='https://developers.google.com/admin-sdk/reports/'>
   *              https://developers.google.com/admin-sdk/reports/</a>
   *      <tr><th>Discovery Name<td>admin
   *    </table>
   *
   * \section ForMoreInfo For More Information
   *
   * The complete API documentation for using Admin Reports API can be found at
   * <a href='https://developers.google.com/admin-sdk/reports/'>https://developers.google.com/admin-sdk/reports/</a>.
   *
   * For more information about the Google APIs Client Library for .NET, see
   * <a href='https://developers.google.com/api-client-library/dotnet/get_started'>
   * https://developers.google.com/api-client-library/dotnet/get_started</a>
   */
  
  namespace Google.Apis.admin.Reports.reports_v1.Data
  {    
  
      /// <summary>JSON template for a collection of activites.</summary>
      public class Activities : Google.Apis.Requests.IDirectResponseSchema
      {
          /// <summary>ETag of the resource.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("etag")]
          public virtual string ETag { get; set; } 
  
          /// <summary>Each record in read response.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("items")]
          public virtual System.Collections.Generic.IList<Activity> Items { get; set; } 
  
          /// <summary>Kind of list response this is.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("kind")]
          public virtual string Kind { get; set; } 
  
          /// <summary>Token for retrieving the next page</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
          public virtual string NextPageToken { get; set; } 
  
      }    
  
      /// <summary>JSON template for the activity resource.</summary>
      public class Activity : Google.Apis.Requests.IDirectResponseSchema
      {
          /// <summary>User doing the action.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("actor")]
          public virtual Activity.ActorData Actor { get; set; } 
  
          /// <summary>ETag of the entry.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("etag")]
          public virtual string ETag { get; set; } 
  
          /// <summary>Activity events.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("events")]
          public virtual System.Collections.Generic.IList<Activity.EventsData> Events { get; set; } 
  
          /// <summary>Unique identifier for each activity record.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("id")]
          public virtual Activity.IdData Id { get; set; } 
  
          /// <summary>IP Address of the user doing the action.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("ipAddress")]
          public virtual string IpAddress { get; set; } 
  
          /// <summary>Kind of resource this is.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("kind")]
          public virtual string Kind { get; set; } 
  
          /// <summary>Domain of source customer.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("ownerDomain")]
          public virtual string OwnerDomain { get; set; } 
  
          
  
          /// <summary>User doing the action.</summary>
          public class ActorData
          {
              /// <summary>User or OAuth 2LO request.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("callerType")]
              public virtual string CallerType { get; set; } 
  
              /// <summary>Email address of the user.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("email")]
              public virtual string Email { get; set; } 
  
              /// <summary>For OAuth 2LO API requests, consumer_key of the requestor.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("key")]
              public virtual string Key { get; set; } 
  
              /// <summary>Obfuscated user id of the user.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("profileId")]
              public virtual string ProfileId { get; set; } 
  
          }    
  
          public class EventsData
          {
              /// <summary>Name of event.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("name")]
              public virtual string Name { get; set; } 
  
              /// <summary>Parameter value pairs for various applications.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("parameters")]
              public virtual System.Collections.Generic.IList<EventsData.ParametersData> Parameters { get; set; } 
  
              /// <summary>Type of event.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("type")]
              public virtual string Type { get; set; } 
  
              
  
              public class ParametersData
              {
                  /// <summary>Boolean value of the parameter.</summary>
                  [Newtonsoft.Json.JsonPropertyAttribute("boolValue")]
                  public virtual System.Nullable<bool> BoolValue { get; set; } 
  
                  /// <summary>Integral value of the parameter.</summary>
                  [Newtonsoft.Json.JsonPropertyAttribute("intValue")]
                  public virtual System.Nullable<long> IntValue { get; set; } 
  
                  /// <summary>Multi-int value of the parameter.</summary>
                  [Newtonsoft.Json.JsonPropertyAttribute("multiIntValue")]
                  public virtual System.Collections.Generic.IList<System.Nullable<long>> MultiIntValue { get; set; } 
  
                  /// <summary>Multi-string value of the parameter.</summary>
                  [Newtonsoft.Json.JsonPropertyAttribute("multiValue")]
                  public virtual System.Collections.Generic.IList<string> MultiValue { get; set; } 
  
                  /// <summary>The name of the parameter.</summary>
                  [Newtonsoft.Json.JsonPropertyAttribute("name")]
                  public virtual string Name { get; set; } 
  
                  /// <summary>String value of the parameter.</summary>
                  [Newtonsoft.Json.JsonPropertyAttribute("value")]
                  public virtual string Value { get; set; } 
  
              }
          }    
  
          /// <summary>Unique identifier for each activity record.</summary>
          public class IdData
          {
              /// <summary>Application name to which the event belongs.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("applicationName")]
              public virtual string ApplicationName { get; set; } 
  
              /// <summary>Obfuscated customer ID of the source customer.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("customerId")]
              public virtual string CustomerId { get; set; } 
  
              /// <summary>Time of occurrence of the activity.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("time")]
              public virtual string TimeRaw { get; set; }
  
              /// <summary><seealso cref="System.DateTime"/> representation of <see cref="TimeRaw"/>.</summary>
              [Newtonsoft.Json.JsonIgnore]
              public virtual System.Nullable<System.DateTime> Time
              {
                  get
                  {
                      return Google.Apis.Util.Utilities.GetDateTimeFromString(TimeRaw);
                  }
                  set
                  {
                      TimeRaw = Google.Apis.Util.Utilities.GetStringFromDateTime(value);
                  }
              }
  
              /// <summary>Unique qualifier if multiple events have the same time.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("uniqueQualifier")]
              public virtual System.Nullable<long> UniqueQualifier { get; set; } 
  
          }
      }    
  
      /// <summary>An notification channel used to watch for resource changes.</summary>
      public class Channel : Google.Apis.Requests.IDirectResponseSchema
      {
          /// <summary>The address where notifications are delivered for this channel.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("address")]
          public virtual string Address { get; set; } 
  
          /// <summary>Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds.
          /// Optional.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("expiration")]
          public virtual System.Nullable<long> Expiration { get; set; } 
  
          /// <summary>A UUID or similar unique string that identifies this channel.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("id")]
          public virtual string Id { get; set; } 
  
          /// <summary>Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed
          /// string "api#channel".</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("kind")]
          public virtual string Kind { get; set; } 
  
          /// <summary>Additional parameters controlling delivery channel behavior. Optional.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("params")]
          public virtual System.Collections.Generic.IDictionary<string,string> Params__ { get; set; } 
  
          /// <summary>A Boolean value to indicate whether payload is wanted. Optional.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("payload")]
          public virtual System.Nullable<bool> Payload { get; set; } 
  
          /// <summary>An opaque ID that identifies the resource being watched on this channel. Stable across different
          /// API versions.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("resourceId")]
          public virtual string ResourceId { get; set; } 
  
          /// <summary>A version-specific identifier for the watched resource.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("resourceUri")]
          public virtual string ResourceUri { get; set; } 
  
          /// <summary>An arbitrary string delivered to the target address with each notification delivered over this
          /// channel. Optional.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("token")]
          public virtual string Token { get; set; } 
  
          /// <summary>The type of delivery mechanism used for this channel.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("type")]
          public virtual string Type { get; set; } 
  
          /// <summary>The ETag of the item.</summary>
          public virtual string ETag { get; set; }
      }    
  
      /// <summary>JSON template for a usage report.</summary>
      public class UsageReport : Google.Apis.Requests.IDirectResponseSchema
      {
          /// <summary>The date to which the record belongs.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("date")]
          public virtual string Date { get; set; } 
  
          /// <summary>Information about the type of the item.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("entity")]
          public virtual UsageReport.EntityData Entity { get; set; } 
  
          /// <summary>ETag of the resource.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("etag")]
          public virtual string ETag { get; set; } 
  
          /// <summary>The kind of object.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("kind")]
          public virtual string Kind { get; set; } 
  
          /// <summary>Parameter value pairs for various applications.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("parameters")]
          public virtual System.Collections.Generic.IList<UsageReport.ParametersData> Parameters { get; set; } 
  
          
  
          /// <summary>Information about the type of the item.</summary>
          public class EntityData
          {
              /// <summary>Obfuscated customer id for the record.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("customerId")]
              public virtual string CustomerId { get; set; } 
  
              /// <summary>Obfuscated user id for the record.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("profileId")]
              public virtual string ProfileId { get; set; } 
  
              /// <summary>The type of item, can be a customer or user.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("type")]
              public virtual string Type { get; set; } 
  
              /// <summary>user's email.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("userEmail")]
              public virtual string UserEmail { get; set; } 
  
          }    
  
          public class ParametersData
          {
              /// <summary>Boolean value of the parameter.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("boolValue")]
              public virtual System.Nullable<bool> BoolValue { get; set; } 
  
              /// <summary>RFC 3339 formatted value of the parameter.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("datetimeValue")]
              public virtual string DatetimeValueRaw { get; set; }
  
              /// <summary><seealso cref="System.DateTime"/> representation of <see cref="DatetimeValueRaw"/>.</summary>
              [Newtonsoft.Json.JsonIgnore]
              public virtual System.Nullable<System.DateTime> DatetimeValue
              {
                  get
                  {
                      return Google.Apis.Util.Utilities.GetDateTimeFromString(DatetimeValueRaw);
                  }
                  set
                  {
                      DatetimeValueRaw = Google.Apis.Util.Utilities.GetStringFromDateTime(value);
                  }
              }
  
              /// <summary>Integral value of the parameter.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("intValue")]
              public virtual System.Nullable<long> IntValue { get; set; } 
  
              /// <summary>Nested message value of the parameter.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("msgValue")]
              public virtual System.Collections.Generic.IList<System.Collections.Generic.IDictionary<string,object>> MsgValue { get; set; } 
  
              /// <summary>The name of the parameter.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("name")]
              public virtual string Name { get; set; } 
  
              /// <summary>String value of the parameter.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("stringValue")]
              public virtual string StringValue { get; set; } 
  
          }
      }    
  
      /// <summary>JSON template for a collection of usage reports.</summary>
      public class UsageReports : Google.Apis.Requests.IDirectResponseSchema
      {
          /// <summary>ETag of the resource.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("etag")]
          public virtual string ETag { get; set; } 
  
          /// <summary>The kind of object.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("kind")]
          public virtual string Kind { get; set; } 
  
          /// <summary>Token for retrieving the next page</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
          public virtual string NextPageToken { get; set; } 
  
          /// <summary>Various application parameter records.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("usageReports")]
          public virtual System.Collections.Generic.IList<UsageReport> UsageReportsValue { get; set; } 
  
          /// <summary>Warnings if any.</summary>
          [Newtonsoft.Json.JsonPropertyAttribute("warnings")]
          public virtual System.Collections.Generic.IList<UsageReports.WarningsData> Warnings { get; set; } 
  
          
  
          public class WarningsData
          {
              /// <summary>Machine readable code / warning type.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("code")]
              public virtual string Code { get; set; } 
  
              /// <summary>Key-Value pairs to give detailed information on the warning.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("data")]
              public virtual System.Collections.Generic.IList<WarningsData.DataData> Data { get; set; } 
  
              /// <summary>Human readable message for the warning.</summary>
              [Newtonsoft.Json.JsonPropertyAttribute("message")]
              public virtual string Message { get; set; } 
  
              
  
              public class DataData
              {
                  /// <summary>Key associated with a key-value pair to give detailed information on the warning.</summary>
                  [Newtonsoft.Json.JsonPropertyAttribute("key")]
                  public virtual string Key { get; set; } 
  
                  /// <summary>Value associated with a key-value pair to give detailed information on the
                  /// warning.</summary>
                  [Newtonsoft.Json.JsonPropertyAttribute("value")]
                  public virtual string Value { get; set; } 
  
              }
          }
      }
  }
  
  namespace Google.Apis.admin.Reports.reports_v1
  {
      /// <summary>The Reports Service.</summary>
      public class ReportsService : Google.Apis.Services.BaseClientService
      {
          /// <summary>The API version.</summary>
          public const string Version = "reports_v1";
  
          /// <summary>The discovery version used to generate this service.</summary>
          public static Google.Apis.Discovery.DiscoveryVersion DiscoveryVersionUsed =
              Google.Apis.Discovery.DiscoveryVersion.Version_1_0;
  
          /// <summary>Constructs a new service.</summary>
          public ReportsService() :
              this(new Google.Apis.Services.BaseClientService.Initializer()) {}
  
          /// <summary>Constructs a new service.</summary>
          /// <param name="initializer">The service initializer.</param>
          public ReportsService(Google.Apis.Services.BaseClientService.Initializer initializer)
              : base(initializer)
          {
              activities = new ActivitiesResource(this);
              channels = new ChannelsResource(this);
              customerUsageReports = new CustomerUsageReportsResource(this);
              userUsageReport = new UserUsageReportResource(this);
          }
  
          /// <summary>Gets the service supported features.</summary>
          public override System.Collections.Generic.IList<string> Features
          {
              get { return new string[0]; }
          }
  
          /// <summary>Gets the service name.</summary>
          public override string Name
          {
              get { return "admin"; }
          }
  
          /// <summary>Gets the service base URI.</summary>
          public override string BaseUri
          {
              get { return "https://www.googleapis.com/admin/reports/v1/"; }
          }
  
          /// <summary>Gets the service base path.</summary>
          public override string BasePath
          {
              get { return "admin/reports/v1/"; }
          }
  
          /// <summary>Available OAuth 2.0 scopes for use with the Admin Reports API.</summary>
          public class Scope
          {
              /// <summary>View audit reports of Google Apps for your domain</summary>
              public static string AdminReportsAuditReadonly = "https://www.googleapis.com/auth/admin.reports.audit.readonly";
  
              /// <summary>View usage reports of Google Apps for your domain</summary>
              public static string AdminReportsUsageReadonly = "https://www.googleapis.com/auth/admin.reports.usage.readonly";
  
          }
  
  
  
          private readonly ActivitiesResource activities;
  
          /// <summary>Gets the Activities resource.</summary>
          public virtual ActivitiesResource Activities
          {
  
gt:             get { return activities; }