Esempio n. 1
0
        /// <summary>
        /// Run the code example.
        /// </summary>
        /// <param name="service">An initialized Dfa Reporting service object
        /// </param>
        public override void Run(DfareportingService service)
        {
            long floodlightConfigurationId =
                long.Parse(_T("INSERT_FLOODLIGHT_CONFIGURATION_ID_HERE"));
            long profileId = long.Parse(_T("INSERT_USER_PROFILE_ID_HERE"));

            String groupName = _T("INSERT_GROUP_NAME_HERE");

            // [START create_group] MOE:strip_line
            // Create the floodlight activity group.
            FloodlightActivityGroup floodlightActivityGroup = new FloodlightActivityGroup();

            floodlightActivityGroup.Name = groupName;
            floodlightActivityGroup.FloodlightConfigurationId = floodlightConfigurationId;
            floodlightActivityGroup.Type = "COUNTER";
            // [END create_group] MOE:strip_line

            // [START insert_group] MOE:strip_line
            // Insert the activity group.
            FloodlightActivityGroup result =
                service.FloodlightActivityGroups.Insert(floodlightActivityGroup, profileId).Execute();

            // [END insert_group] MOE:strip_line

            // Display the new activity group ID.
            if (result != null)
            {
                Console.WriteLine("Activity group with ID {0} was created.", result.Id);
            }
        }
    /// <summary>
    /// Run the code example.
    /// </summary>
    /// <param name="service">An initialized Dfa Reporting service object
    /// </param>
    public override void Run(DfareportingService service) {
      long floodlightConfigurationId =
          long.Parse(_T("INSERT_FLOODLIGHT_CONFIGURATION_ID_HERE"));
      long profileId = long.Parse(_T("INSERT_USER_PROFILE_ID_HERE"));

      String groupName = _T("INSERT_GROUP_NAME_HERE");

      // Create the floodlight activity group.
      FloodlightActivityGroup floodlightActivityGroup = new FloodlightActivityGroup();
      floodlightActivityGroup.Name = groupName;
      floodlightActivityGroup.FloodlightConfigurationId = floodlightConfigurationId;
      floodlightActivityGroup.Type = "COUNTER";

      // Insert the activity group.
      FloodlightActivityGroup result =
          service.FloodlightActivityGroups.Insert(floodlightActivityGroup, profileId).Execute();

      // Display the new activity group ID.
      if (result != null) {
        Console.WriteLine("Activity group with ID {0} was created.", result.Id);
      }
    }
Esempio n. 3
0
        /// <summary>
        /// Inserts a new floodlight activity group.
        /// Documentation https://developers.google.com/dfareporting/v2.8/reference/floodlightActivityGroups/insert
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Dfareporting service.</param>
        /// <param name="profileId">User profile ID associated with this request.</param>
        /// <param name="body">A valid Dfareporting v2.8 body.</param>
        /// <returns>FloodlightActivityGroupResponse</returns>
        public static FloodlightActivityGroup Insert(DfareportingService service, string profileId, FloodlightActivityGroup body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (profileId == null)
                {
                    throw new ArgumentNullException(profileId);
                }

                // Make the request.
                return(service.FloodlightActivityGroups.Insert(body, profileId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request FloodlightActivityGroups.Insert failed.", ex);
            }
        }