hunk.code_window: 	}
   	// CLIFlags represents the available flags on the CLI.
   	CLIFlags struct {
   		Addr      *string
   		Assets    *string
   		Data      *string
   		Endpoint  *string
   		Labels    *[]Pair
   		Logo      *string
   		Templates *string
   		NoAuth    *bool
   		TLSVerify *bool
   		TLSCacert *string
   		TLSCert   *string
   		TLSKey    *string
   	}
   	// Settings represents Portainer settings.
  
hunk.labels: keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep
hunk.after_edit: 		Addr        *string
   		Assets      *string
   		Data        *string
   		Endpoint    *string
   		Labels      *[]Pair
   		Logo        *string
   		Templates   *string
   		NoAuth      *bool
   		NoAnalytics *bool
   		TLSVerify   *bool
   		TLSCacert   *string
   		TLSCert     *string
   		TLSKey      *string
  
hunk.file_path: api/portainer.go
hunk.type: replace
file: angular.module('portainer.services')
  .factory('ContainerService', ['$q', 'Container', 'ContainerHelper', function ContainerServiceFactory($q, Container, ContainerHelper) {
    'use strict';
    var service = {};
  
    service.getContainers = function (all, hiddenLabels) {
      var deferred = $q.defer();
      Container.query({ all: all }).$promise
      .then(function success(data) {
        var containers = data;
        if (hiddenLabels) {
          containers = ContainerHelper.hideContainers(d, hiddenLabels);
        }
        deferred.resolve(data);
      })
      .catch(function error(err) {
        deferred.reject({ msg: 'Unable to retriever containers', err: err });
      });
      return deferred.promise;
    };
  
    service.createContainer = function(configuration) {
      var deferred = $q.defer();
      Container.create(configuration).$promise
      .then(function success(data) {
        if (data.message) {
          deferred.reject({ msg: data.message });
        } else {
          deferred.resolve(data);
        }
      })
      .catch(function error(err) {
        deferred.reject({ msg: 'Unable to create container', err: err });
      });
      return deferred.promise;
    };
  
    service.startContainer = function(containerID) {
      var deferred = $q.defer();
      Container.start({ id: containerID }, {}).$promise
      .then(function success(data) {
        if (data.message) {
          deferred.reject({ msg: data.message });
        } else {
          deferred.resolve(data);
        }
      })
      .catch(function error(err) {
        deferred.reject({ msg: 'Unable to start container', err: err });
      });
      return deferred.promise;
    };
  
    service.createAndStartContainer = function(configuration) {
      var deferred = $q.defer();
      var containerID;
      service.createContainer(configuration)
      .then(function success(data) {
        containerID = data.Id;
        return service.startContainer(containerID);
      })
      .then(function success() {
        deferred.resolve({ Id: containerID });
      })
      .catch(function error(err) {
        deferred.reject(err);
      });
      return deferred.promise;
    };
    return service;
  }]);
  